Change to go1.6.1 and vendoring

This commit is contained in:
Iwasaki Yudai 2016-04-13 16:01:14 +09:00
parent b1c5226875
commit a350994aa2
164 changed files with 17 additions and 1383 deletions

40
vendor/github.com/yudai/hcl/json/parse.go generated vendored Normal file
View file

@ -0,0 +1,40 @@
package json
import (
"sync"
"github.com/yudai/hcl/hcl"
"github.com/hashicorp/go-multierror"
)
// jsonErrors are the errors built up from parsing. These should not
// be accessed directly.
var jsonErrors []error
var jsonLock sync.Mutex
var jsonResult *hcl.Object
// Parse parses the given string and returns the result.
func Parse(v string) (*hcl.Object, error) {
jsonLock.Lock()
defer jsonLock.Unlock()
jsonErrors = nil
jsonResult = nil
// Parse
lex := &jsonLex{Input: v}
jsonParse(lex)
// If we have an error in the lexer itself, return it
if lex.err != nil {
return nil, lex.err
}
// Build up the errors
var err error
if len(jsonErrors) > 0 {
err = &multierror.Error{Errors: jsonErrors}
jsonResult = nil
}
return jsonResult, err
}