Skip to content

Commit

Permalink
docs: add example
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Feb 12, 2024
1 parent e08f021 commit b267968
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@

xmlq is a Go library for pretty printing xml and masking element values.

## Usage

```go
var xmlData io.Reader

output, err := MarshalIndent(xmlData, &Options{
Indent: " ", // two spaces
Masks: []Mask{
{
// <ct:Id>11000179512199001</ct:Id>
Name: "Id",
Mask: ShowLastFour,
},
{
// <ct:Nm>John Doe</ct:Nm>
Name: "Nm",
Mask: ShowWordStart,
},
},
})
```

## Supported and tested platforms

- 64-bit Linux (Ubuntu, Debian), macOS, and Windows
Expand Down

0 comments on commit b267968

Please sign in to comment.