From 3277a509499760235611137b0b8e7282d54c3ec3 Mon Sep 17 00:00:00 2001 From: Dinh Date: Tue, 28 Sep 2021 21:39:44 +0700 Subject: [PATCH 1/2] github actions --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ flat.go | 2 +- go.mod | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5a45f17 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: build +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: ^1.16 + id: go + + - name: Check out code + uses: actions/checkout@v2 + + - name: Install deps + shell: bash --noprofile --norc -x -eo pipefail {0} + run: | + go get -u honnef.co/go/tools/cmd/staticcheck + go get -u github.com/client9/misspell/cmd/misspell + + - name: Lint + shell: bash --noprofile --norc -x -eo pipefail {0} + run: | + $(exit $(go fmt ./... | wc -l)) + misspell -error -locale US . + staticcheck ./... + + - name: Test + run: | + go test -race ./... \ No newline at end of file diff --git a/flat.go b/flat.go index 7515b0e..732712a 100644 --- a/flat.go +++ b/flat.go @@ -113,7 +113,7 @@ func unflatten(flat map[string]interface{}, opts *Options) (nested map[string]in for k, v := range flat { temp := uf(k, v, opts).(map[string]interface{}) - err = mergo.Merge(&nested, temp, func(c *mergo.Config) {c.Overwrite = true}) + err = mergo.Merge(&nested, temp, func(c *mergo.Config) { c.Overwrite = true }) if err != nil { return } diff --git a/go.mod b/go.mod index 2bc6162..e0f15b9 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/nqd/flat -go 1.12 +go 1.16 require github.com/imdario/mergo v0.3.12 From 0ba30a04d1be94a5a14c3fc80aa491aec2d6f488 Mon Sep 17 00:00:00 2001 From: Dinh Date: Tue, 28 Sep 2021 22:19:06 +0700 Subject: [PATCH 2/2] remove travis ci --- .travis.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 265192a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: go - -sudo: false - -go: -- 1.12.x - -env: -- GO111MODULE=off - -install: -- go get -t ./... -- go get -u honnef.co/go/tools/cmd/staticcheck -- go get -u github.com/client9/misspell/cmd/misspell - -before_script: -- $(exit $(go fmt ./... | wc -l)) -- go vet ./... -- misspell -error -locale US . -- staticcheck ./... - -script: -- go test -race ./... \ No newline at end of file