Skip to content

Commit

Permalink
Merge bbed74e into b1641c0
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyLoy committed Nov 3, 2019
2 parents b1641c0 + bbed74e commit 98f154d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/go.yml
@@ -0,0 +1,27 @@
name: Go
on: [push]
jobs:

test:
name: Test on go ${{ matrix.go_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_Version: ['1.13']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:

- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go_version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Test
run: go test -v

- name: vet
run: go vet
10 changes: 2 additions & 8 deletions config_test.go
Expand Up @@ -33,12 +33,6 @@ func Test_Integration(t *testing.T) {
}
defer os.Remove(file.Name())

nonExistFile, err := ioutil.TempFile("", "nonexistfile")
if err != nil {
t.Fatalf("failed to create temporary file: %v", err)
}
os.Remove(nonExistFile.Name())

testData := strings.Join([]string{
"A=1",
"B=abc",
Expand Down Expand Up @@ -80,9 +74,9 @@ func Test_Integration(t *testing.T) {
I: "",
K: "hardcoded",
}
wantFailedFields := []string{"file[" + nonExistFile.Name() + "]", "g[1]", "h"}
wantFailedFields := []string{"file[nonexistfile]", "g[1]", "h"}

builder := From(file.Name()).From(nonExistFile.Name()).FromEnv()
builder := From(file.Name()).From("nonexistfile").FromEnv()
gotErr := builder.To(&got)
if !reflect.DeepEqual(got, want) {
t.Errorf("Integration: got %+v, want %+v", got, want)
Expand Down

0 comments on commit 98f154d

Please sign in to comment.