From 6ffa5d14556c84d53c5b7e3dfe630c3ee1a81ce6 Mon Sep 17 00:00:00 2001 From: joeybloggs Date: Sun, 7 Jun 2015 23:25:14 -0400 Subject: [PATCH] add thread safety note to AddFunction and SetTag functions --- validator.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/validator.go b/validator.go index 8a85c69..020d3c8 100644 --- a/validator.go +++ b/validator.go @@ -195,12 +195,14 @@ func New(tagName string, funcs map[string]Func) *Validate { // SetTag sets tagName of the Validator to one of your choosing after creation // perhaps to dodge a tag name conflict in a specific section of code +// NOTE: this method is not thread-safe func (v *Validate) SetTag(tagName string) { v.tagName = tagName } // AddFunction adds a validation Func to a Validate's map of validators denoted by the key // NOTE: if the key already exists, it will get replaced. +// NOTE: this method is not thread-safe func (v *Validate) AddFunction(key string, f Func) error { if len(key) == 0 {