Skip to content

Commit

Permalink
adds proper usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
gidsi committed Oct 20, 2017
1 parent d2b0c0f commit 1395484
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ package main

import (
validator "github.com/gidsi/go-spaceapi-validator"
fmt
"fmt"
"strconv"
)

func main() {
fmt.Println("Validate with following commit: " + validator.CommitHash)
validator.Validate(/* spaceapi json you want to validate */)
fmt.Println("Validate with following commigithub.com/gidsi/go-spaceapi-validatort: " + validator.CommitHash)
result, err := validator.Validate(`{}`/* spaceapi json you want to validate */)

if err != nil {
panic(err)
}

fmt.Println("Provided data is valid: " + strconv.FormatBool(result.Valid))
fmt.Println(result.Errors)
}
```

Expand Down

0 comments on commit 1395484

Please sign in to comment.