Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 814 Bytes

File metadata and controls

41 lines (29 loc) · 814 Bytes

json-validator-go

A json validator for golang

Getting started

Prerequisites

Getting json-validator-go

With Go module support, simply add the following import

import "github.com/luduoxin/json-validator-go/validator"

Otherwise, run the following Go command to install the json-validator-go package:

$ go get -u github.com/luduoxin/json-validator-go

using json-validator-go

package main

import (
	"fmt"
	"github.com/luduoxin/json-validator-go/validator"
)

func main() {
	dataStr := `{"foo":"bar"}`
	err := validator.Valid([]byte(dataStr))
	fmt.Println(err)
}

Contributing

We appreciate your help!