From f3c899de7914e8a82fdbfbd1bd81df24353c6627 Mon Sep 17 00:00:00 2001 From: Dalton Tan Date: Thu, 29 Jun 2023 22:08:14 +0800 Subject: [PATCH] doc: fix docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e7e9bdb..2302344 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ validating wrongly. ## Examples To define your own validator, you must implement the -[Validator](https://godoc.org/github.com/AgentCosmic/xvalid#Validator) interface. For example,, see any of the +[Validator](https://godoc.org/github.com/AgentCosmic/xvalid#Validator) interface. For example, see any of the validators in [validators.go](https://github.com/AgentCosmic/xvalid/blob/master/validators.go) Define rules and validate objects: -``` +```go // Store model type Store struct { Name string `json:"name"` @@ -78,7 +78,7 @@ if err != nil { Export rules as JSON: -``` +```go func createValidationMap(model ...ruleHolder) map[string]interface{} { rules := make(map[string]interface{}) for _, m := range model {