Upgrading server dependancies (#6431)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cd23b8139a
Коммит
d103ed6ca9
2
vendor/github.com/hashicorp/hcl/appveyor.yml
сгенерированный
поставляемый
2
vendor/github.com/hashicorp/hcl/appveyor.yml
сгенерированный
поставляемый
@@ -4,7 +4,7 @@ clone_folder: c:\gopath\src\github.com\hashicorp\hcl
|
||||
environment:
|
||||
GOPATH: c:\gopath
|
||||
init:
|
||||
- git config --global core.autocrlf true
|
||||
- git config --global core.autocrlf false
|
||||
install:
|
||||
- cmd: >-
|
||||
echo %Path%
|
||||
|
||||
4
vendor/github.com/hashicorp/hcl/decoder.go
сгенерированный
поставляемый
4
vendor/github.com/hashicorp/hcl/decoder.go
сгенерированный
поставляемый
@@ -89,7 +89,7 @@ func (d *decoder) decode(name string, node ast.Node, result reflect.Value) error
|
||||
switch k.Kind() {
|
||||
case reflect.Bool:
|
||||
return d.decodeBool(name, node, result)
|
||||
case reflect.Float64:
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return d.decodeFloat(name, node, result)
|
||||
case reflect.Int, reflect.Int32, reflect.Int64:
|
||||
return d.decodeInt(name, node, result)
|
||||
@@ -143,7 +143,7 @@ func (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value)
|
||||
return err
|
||||
}
|
||||
|
||||
result.Set(reflect.ValueOf(v))
|
||||
result.Set(reflect.ValueOf(v).Convert(result.Type()))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
85
vendor/github.com/hashicorp/hcl/decoder_test.go
сгенерированный
поставляемый
85
vendor/github.com/hashicorp/hcl/decoder_test.go
сгенерированный
поставляемый
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/hashicorp/hcl/hcl/ast"
|
||||
"github.com/hashicorp/hcl/testhelper"
|
||||
)
|
||||
|
||||
func TestDecode_interface(t *testing.T) {
|
||||
@@ -89,8 +88,7 @@ func TestDecode_interface(t *testing.T) {
|
||||
{
|
||||
"multiline_literal_with_hil.hcl",
|
||||
false,
|
||||
map[string]interface{}{"multiline_literal_with_hil": testhelper.Unix2dos(`${hello
|
||||
world}`)},
|
||||
map[string]interface{}{"multiline_literal_with_hil": "${hello\n world}"},
|
||||
},
|
||||
{
|
||||
"multiline_no_marker.hcl",
|
||||
@@ -100,22 +98,22 @@ func TestDecode_interface(t *testing.T) {
|
||||
{
|
||||
"multiline.hcl",
|
||||
false,
|
||||
map[string]interface{}{"foo": testhelper.Unix2dos("bar\nbaz\n")},
|
||||
map[string]interface{}{"foo": "bar\nbaz\n"},
|
||||
},
|
||||
{
|
||||
"multiline_indented.hcl",
|
||||
false,
|
||||
map[string]interface{}{"foo": testhelper.Unix2dos(" bar\n baz\n")},
|
||||
map[string]interface{}{"foo": " bar\n baz\n"},
|
||||
},
|
||||
{
|
||||
"multiline_no_hanging_indent.hcl",
|
||||
false,
|
||||
map[string]interface{}{"foo": testhelper.Unix2dos(" baz\n bar\n foo\n")},
|
||||
map[string]interface{}{"foo": " baz\n bar\n foo\n"},
|
||||
},
|
||||
{
|
||||
"multiline_no_eof.hcl",
|
||||
false,
|
||||
map[string]interface{}{"foo": testhelper.Unix2dos("bar\nbaz\n"), "key": "value"},
|
||||
map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"},
|
||||
},
|
||||
{
|
||||
"multiline.json",
|
||||
@@ -421,31 +419,32 @@ func TestDecode_interface(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Logf("Testing: %s", tc.File)
|
||||
d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
t.Run(tc.File, func(t *testing.T) {
|
||||
d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
var out interface{}
|
||||
err = Decode(&out, string(d))
|
||||
if (err != nil) != tc.Err {
|
||||
t.Fatalf("Input: %s\n\nError: %s", tc.File, err)
|
||||
}
|
||||
var out interface{}
|
||||
err = Decode(&out, string(d))
|
||||
if (err != nil) != tc.Err {
|
||||
t.Fatalf("Input: %s\n\nError: %s", tc.File, err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(out, tc.Out) {
|
||||
t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out)
|
||||
}
|
||||
if !reflect.DeepEqual(out, tc.Out) {
|
||||
t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out)
|
||||
}
|
||||
|
||||
var v interface{}
|
||||
err = Unmarshal(d, &v)
|
||||
if (err != nil) != tc.Err {
|
||||
t.Fatalf("Input: %s\n\nError: %s", tc.File, err)
|
||||
}
|
||||
var v interface{}
|
||||
err = Unmarshal(d, &v)
|
||||
if (err != nil) != tc.Err {
|
||||
t.Fatalf("Input: %s\n\nError: %s", tc.File, err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(v, tc.Out) {
|
||||
t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out)
|
||||
}
|
||||
if !reflect.DeepEqual(v, tc.Out) {
|
||||
t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,6 +808,36 @@ func TestDecode_intString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecode_float32(t *testing.T) {
|
||||
var value struct {
|
||||
A float32 `hcl:"a"`
|
||||
}
|
||||
|
||||
err := Decode(&value, testReadFile(t, "float.hcl"))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if got, want := value.A, float32(1.02); got != want {
|
||||
t.Fatalf("wrong result %#v; want %#v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecode_float64(t *testing.T) {
|
||||
var value struct {
|
||||
A float64 `hcl:"a"`
|
||||
}
|
||||
|
||||
err := Decode(&value, testReadFile(t, "float.hcl"))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if got, want := value.A, float64(1.02); got != want {
|
||||
t.Fatalf("wrong result %#v; want %#v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecode_intStringAliased(t *testing.T) {
|
||||
var value struct {
|
||||
Count time.Duration
|
||||
|
||||
6
vendor/github.com/hashicorp/hcl/hcl/parser/parser.go
сгенерированный
поставляемый
6
vendor/github.com/hashicorp/hcl/hcl/parser/parser.go
сгенерированный
поставляемый
@@ -3,6 +3,7 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -36,6 +37,11 @@ func newParser(src []byte) *Parser {
|
||||
|
||||
// Parse returns the fully parsed source and returns the abstract syntax tree.
|
||||
func Parse(src []byte) (*ast.File, error) {
|
||||
// normalize all line endings
|
||||
// since the scanner and output only work with "\n" line endings, we may
|
||||
// end up with dangling "\r" characters in the parsed data.
|
||||
src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1)
|
||||
|
||||
p := newParser(src)
|
||||
return p.Parse()
|
||||
}
|
||||
|
||||
9
vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go
сгенерированный
поставляемый
9
vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go
сгенерированный
поставляемый
@@ -393,6 +393,7 @@ func TestCommentGroup(t *testing.T) {
|
||||
groups int
|
||||
}{
|
||||
{"# Hello\n# World", 1},
|
||||
{"# Hello\r\n# Windows", 1},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
@@ -424,6 +425,10 @@ func TestParse(t *testing.T) {
|
||||
"comment.hcl",
|
||||
false,
|
||||
},
|
||||
{
|
||||
"comment_crlf.hcl",
|
||||
false,
|
||||
},
|
||||
{
|
||||
"comment_lastline.hcl",
|
||||
false,
|
||||
@@ -464,6 +469,10 @@ func TestParse(t *testing.T) {
|
||||
"complex.hcl",
|
||||
false,
|
||||
},
|
||||
{
|
||||
"complex_crlf.hcl",
|
||||
false,
|
||||
},
|
||||
{
|
||||
"types.hcl",
|
||||
false,
|
||||
|
||||
30
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl
сгенерированный
поставляемый
30
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl
сгенерированный
поставляемый
@@ -1,15 +1,15 @@
|
||||
// Foo
|
||||
|
||||
/* Bar */
|
||||
|
||||
/*
|
||||
/*
|
||||
Baz
|
||||
*/
|
||||
|
||||
# Another
|
||||
|
||||
# Multiple
|
||||
# Lines
|
||||
|
||||
foo = "bar"
|
||||
// Foo
|
||||
|
||||
/* Bar */
|
||||
|
||||
/*
|
||||
/*
|
||||
Baz
|
||||
*/
|
||||
|
||||
# Another
|
||||
|
||||
# Multiple
|
||||
# Lines
|
||||
|
||||
foo = "bar"
|
||||
|
||||
15
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_crlf.hcl
сгенерированный
поставляемый
Обычный файл
15
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_crlf.hcl
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,15 @@
|
||||
// Foo
|
||||
|
||||
/* Bar */
|
||||
|
||||
/*
|
||||
/*
|
||||
Baz
|
||||
*/
|
||||
|
||||
# Another
|
||||
|
||||
# Multiple
|
||||
# Lines
|
||||
|
||||
foo = "bar"
|
||||
42
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_crlf.hcl
сгенерированный
поставляемый
Обычный файл
42
vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_crlf.hcl
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,42 @@
|
||||
variable "foo" {
|
||||
default = "bar"
|
||||
description = "bar"
|
||||
}
|
||||
|
||||
variable "groups" { }
|
||||
|
||||
provider "aws" {
|
||||
access_key = "foo"
|
||||
secret_key = "bar"
|
||||
}
|
||||
|
||||
provider "do" {
|
||||
api_key = "${var.foo}"
|
||||
}
|
||||
|
||||
resource "aws_security_group" "firewall" {
|
||||
count = 5
|
||||
}
|
||||
|
||||
resource aws_instance "web" {
|
||||
ami = "${var.foo}"
|
||||
security_groups = [
|
||||
"foo",
|
||||
"${aws_security_group.firewall.foo}",
|
||||
"${element(split(\",\", var.groups)}",
|
||||
]
|
||||
network_interface = {
|
||||
device_index = 0
|
||||
description = "Main network interface"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "db" {
|
||||
security_groups = "${aws_security_group.firewall.*.id}"
|
||||
VPC = "foo"
|
||||
depends_on = ["aws_instance.web"]
|
||||
}
|
||||
|
||||
output "web_ip" {
|
||||
value = "${aws_instance.web.private_ip}"
|
||||
}
|
||||
1
vendor/github.com/hashicorp/hcl/hcl/printer/printer.go
сгенерированный
поставляемый
1
vendor/github.com/hashicorp/hcl/hcl/printer/printer.go
сгенерированный
поставляемый
@@ -62,6 +62,5 @@ func Format(src []byte) ([]byte, error) {
|
||||
|
||||
// Add trailing newline to result
|
||||
buf.WriteString("\n")
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
10
vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go
сгенерированный
поставляемый
10
vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go
сгенерированный
поставляемый
@@ -1,8 +1,3 @@
|
||||
// +build !windows
|
||||
// TODO(jen20): These need fixing on Windows but printer is not used right now
|
||||
// and red CI is making it harder to process other bugs, so ignore until
|
||||
// we get around to fixing them.package printer
|
||||
|
||||
package printer
|
||||
|
||||
import (
|
||||
@@ -33,6 +28,7 @@ var data = []entry{
|
||||
{"list.input", "list.golden"},
|
||||
{"list_comment.input", "list_comment.golden"},
|
||||
{"comment.input", "comment.golden"},
|
||||
{"comment_crlf.input", "comment.golden"},
|
||||
{"comment_aligned.input", "comment_aligned.golden"},
|
||||
{"comment_array.input", "comment_array.golden"},
|
||||
{"comment_end_file.input", "comment_end_file.golden"},
|
||||
@@ -109,8 +105,8 @@ func diff(aname, bname string, a, b []byte) error {
|
||||
for i := 0; i < len(a) && i < len(b); i++ {
|
||||
ch := a[i]
|
||||
if ch != b[i] {
|
||||
fmt.Fprintf(&buf, "\n%s:%d:%d: %s", aname, line, i-offs+1, lineAt(a, offs))
|
||||
fmt.Fprintf(&buf, "\n%s:%d:%d: %s", bname, line, i-offs+1, lineAt(b, offs))
|
||||
fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs))
|
||||
fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs))
|
||||
fmt.Fprintf(&buf, "\n\n")
|
||||
break
|
||||
}
|
||||
|
||||
37
vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input
сгенерированный
поставляемый
Обычный файл
37
vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,37 @@
|
||||
// A standalone comment is a comment which is not attached to any kind of node
|
||||
|
||||
// This comes from Terraform, as a test
|
||||
variable "foo" {
|
||||
# Standalone comment should be still here
|
||||
|
||||
default = "bar"
|
||||
description = "bar" # yooo
|
||||
}
|
||||
|
||||
/* This is a multi line standalone
|
||||
comment*/
|
||||
|
||||
|
||||
// fatih arslan
|
||||
/* This is a developer test
|
||||
account and a multine comment */
|
||||
developer = [ "fatih", "arslan"] // fatih arslan
|
||||
|
||||
# One line here
|
||||
numbers = [1,2] // another line here
|
||||
|
||||
# Another comment
|
||||
variable = {
|
||||
description = "bar" # another yooo
|
||||
foo {
|
||||
# Nested standalone
|
||||
|
||||
bar = "fatih"
|
||||
}
|
||||
}
|
||||
|
||||
// lead comment
|
||||
foo {
|
||||
bar = "fatih" // line comment 2
|
||||
} // line comment 3
|
||||
|
||||
Ссылка в новой задаче
Block a user