diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..8ba7c37 --- /dev/null +++ b/.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 diff --git a/config_test.go b/config_test.go index 76e24cb..58dd765 100644 --- a/config_test.go +++ b/config_test.go @@ -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", @@ -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)