code: func (dec *Decoder) analyzePath() (err error) {
  	inBracket := false
  	bracketClosed := false
  	lastPos := 0
  	endPos := 0
  
  	// parse path
  	for i, char := range []byte(dec.path) {
  		if char == '[' && inBracket == false {
  			// found an opening bracket
  			bracketClosed = false
  			inBracket = true
  			dec.field = dec.path[lastPos:i]
  			lastPos = i + 1
  			continue
  		} else if inBracket {
  			// it is inside of bracket, so get its value
  			if char == ']' {
  				// found an closing bracket, so it will be recently close, so put as true the bracketClosed
  				// and put as false inBracket and pass the value of bracket to dec.key
  				inBracket = false
  				bracketClosed = true
  				dec.bracket = dec.path[lastPos:endPos]
  				lastPos = i + 1
  				if err = dec.traverse(); err != nil {
  					return
  				}
  			} else {
  				// still inside the bracket, so to save the end position
  				endPos = i + 1
  			}
  			continue
  		} else if !inBracket {
  			// not found any bracket, so try found a field
  			if char == '.' {
  				// found a field, we need to know if the field is next of a closing bracket,
  				// for example: [0].Field
  				if bracketClosed {
  					bracketClosed = false
  					lastPos = i + 1
  					continue
  				}
  				// found a field, but is not next of a closing bracket, for example: Field1.Field2
  				dec.field = dec.path[lastPos:i]
  				//dec.field = tmp[:i]
  				lastPos = i + 1
  				if err = dec.traverse(); err != nil {
  					return
  				}
  			}
  			continue
  		}
  	}
  	// last field of path
  	dec.field = dec.path[lastPos:]
  
  	return dec.end()
  }
docs: // analyzePath analyzes the current path to walk through it