Skip to content

Commit

Permalink
README: clarify when flag defaults are used (#78)
Browse files Browse the repository at this point in the history
* README: clarify when flag defaults are used

* go.mod: somewhat pointless bump to go 1.16

* Make GitHub Actions happy
  • Loading branch information
peterbourgon authored Apr 3, 2021
1 parent 7f261de commit 76b11f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.13.x]
go-version: [1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -13,28 +13,25 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Install staticcheck
run: pwd && cd .. && go get -v -u honnef.co/go/tools/cmd/staticcheck && cd -
run: go install honnef.co/go/tools/cmd/staticcheck@latest
shell: bash
- name: Install golint
run: pwd && cd .. && go get -v -u golang.org/x/lint/golint && cd -
run: go install golang.org/x/lint/golint@latest
shell: bash
- name: Update PATH
# https://github.com/actions/setup-go/issues/12#issuecomment-524631719
run: echo "##[add-path]$(go env GOPATH)/bin"
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Checkout code
uses: actions/checkout@v1
- name: Fmt
if: matrix.platform != 'windows-latest' # :(
run: "F=$(gofmt -l .) ; if [[ $F ]] ; then echo $F ; exit 1 ; fi"
run: "diff <(gofmt -d .) <(printf '')"
shell: bash
- name: Vet
run: go vet ./...
- name: Staticcheck
run: staticcheck ./...
- name: Lint
run: golint ./...
- name: Parallel tests
run: hack/lint-parallel-tests.bash
- name: Test
run: go test -race ./...
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ are available to control parse behavior.
```
This example will parse flags from the commandline args, just like regular
package flag, with the highest priority.
package flag, with the highest priority. (The flag's default value will be used
only if the flag remains unset after parsing all provided sources of
configuration.)
Additionally, the example will look in the environment for variables with a
`MY_PROGRAM` prefix. Flag names are capitalized, and separator characters are
Expand All @@ -56,6 +58,7 @@ would match to `listen-addr`.
Finally, if a `-config` file is specified, the example will try to parse it
using the PlainParser, which expects files in this format.
```
listen-addr localhost:8080
refresh 30s
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/peterbourgon/ff/v3

go 1.14
go 1.16

require (
github.com/pelletier/go-toml v1.6.0
Expand Down

0 comments on commit 76b11f3

Please sign in to comment.