Skip to content

Commit 1395484

Browse files
committed
adds proper usage example
1 parent d2b0c0f commit 1395484

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ package main
1212

1313
import (
1414
validator "github.com/gidsi/go-spaceapi-validator"
15-
fmt
15+
"fmt"
16+
"strconv"
1617
)
1718

1819
func main() {
19-
fmt.Println("Validate with following commit: " + validator.CommitHash)
20-
validator.Validate(/* spaceapi json you want to validate */)
20+
fmt.Println("Validate with following commigithub.com/gidsi/go-spaceapi-validatort: " + validator.CommitHash)
21+
result, err := validator.Validate(`{}`/* spaceapi json you want to validate */)
22+
23+
if err != nil {
24+
panic(err)
25+
}
26+
27+
fmt.Println("Provided data is valid: " + strconv.FormatBool(result.Valid))
28+
fmt.Println(result.Errors)
2129
}
2230
```
2331

0 commit comments

Comments
 (0)