Skip to content

Commit

Permalink
🔥 up: remove error sub-pkg dotnev/, update ci config and some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Feb 11, 2023
1 parent 79acc56 commit d52926f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [1.16, 1.17, 1.18, 1.19]
go_version: [1.18, 1.19, '1.20']

steps:
- name: Check out code
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
name: Release new version
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true

steps:
- name: Checkout
Expand Down
47 changes: 0 additions & 47 deletions dotnev/README.md

This file was deleted.

36 changes: 0 additions & 36 deletions dotnev/dotenv.go

This file was deleted.

6 changes: 3 additions & 3 deletions read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestGet(t *testing.T) {
val = Get("name")
is.Eq("app", val)

is.Eq([]string{"php", "go"}, StringsBySplit("tagStr", ","))
is.Eq([]string{"php", "go"}, StringsBySplit("tagsStr", ","))

// get string array
arr := Strings("notExist")
Expand Down Expand Up @@ -433,7 +433,7 @@ func TestParseEnv(t *testing.T) {

tests := []struct{ EKey, EVal, CKey, CVal string }{
{"EnvKey", "EnvKey val", "ekey", "EnvKey val"},
{"EnvKey", "", "ekey", "${EnvKey}"},
{"EnvKey", "", "ekey", ""},
{"EnvKey0", "EnvKey0 val", "ekey0", "EnvKey0 val"},
{"EnvKey3", "EnvKey3 val", "ekey3", "EnvKey3 val"},
{"EnvKey3", "", "ekey3", "app:run"},
Expand Down Expand Up @@ -470,6 +470,6 @@ func TestParseEnv(t *testing.T) {
}, func() {
is.Eq("abc", Getenv("FirstEnv"))
is.Eq("", Getenv("SecondEnv"))
is.Eq("abc/${ SecondEnv }", cfg.String("ekey4"))
is.Eq("abc/", cfg.String("ekey4"))
})
}
8 changes: 5 additions & 3 deletions testdata/config.bak.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"key": "val",
"key1": "val1",
"key2": "val2",
"key3": "${SHELL}"
"key3": "${SHELL}",
"key4": "230"
},
"name": "app",
"new-key": "new-value"
}
"new-key": "new-value",
"tagsStr": "php,go"
}
4 changes: 4 additions & 0 deletions testdata/issues59.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# exported at 2023-02-11 14:42:13

age = 123
baseKey = value
debug = false
envKey = ${SHELL}
envKey1 = ${NotExist|defValue}
multiWords = hello world
name = app

[map1]
key = val
key1 = val1
key2 = val2


0 comments on commit d52926f

Please sign in to comment.