Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freeformz/bits
Random bits of code
https://github.com/freeformz/bits
experimental go golang mage
Last synced: 7 days ago
JSON representation
Random bits of code
- Host: GitHub
- URL: https://github.com/freeformz/bits
- Owner: freeformz
- License: mit
- Created: 2019-09-25T19:02:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T18:04:01.000Z (about 5 years ago)
- Last Synced: 2024-12-24T06:47:35.248Z (10 days ago)
- Topics: experimental, go, golang, mage
- Language: Go
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# bits
### Quick Start
```console
$ export BITS_VERSION="$(curl -s https://api.github.com/repos/freeformz/bits/releases/latest | grep tag_name | awk '{ sub(/"/, "", $2); sub(/",/, "", $2); print $2 }')"
$ go mod init
$ go get github.com/freeformz/bits/cmd/setup@${BITS_VERSION}
$ git init .
$ git add go.mod go.sum
$ git commit -avm "new go module w/bits"
$ go run github.com/freeformz/bits/cmd/setup
go run github.com/freeformz/bits/cmd/setupRepo directory: "/Users/emuller/devel/"
Magefile: "/Users/emuller/devel//magefile.go"
go.mod: "/Users/emuller/devel//go.mod"
.golangci.tml: "/Users/emuller/devel//.golangci.yml"
.gitignore: "/Users/emuller/devel//.gitignore"Module Name: "github.com/heroku/"
Current major Go version: go1.13setup complete!
Files to take a look at:
/Users/emuller/devel//magefile.go: Magefile used to configure bits / write additional tasks
/Users/emuller/devel//.golangci.yml: Golangci-lint config file
/Users/emuller/devel//.gitignore: git ignore file
/Users/emuller/devel//.circleci/config.yml: CircleCI config fileDon't forget to commit the changes/new files.
Run 'mage -f' to see the initial set of mage targets.
```Creates a defaults magefile.go, .circleci config, .gitignore, & .golangci.yml
```console
$ mage -f
Targets:
go:checkVersion checks that the version of go being used is the version specified or the latest version
go:cover runs go tool cover with default args set from `CoverArgs`
go:coverage opens the coverage output in your browser (runs "go tool cover -html=coverage.out")
go:test runs `go test` with default args set from `TestArgs`
golangcilint:remove removes all cached versions of golangci-lint
golangcilint:run runs golangci-lint using RunArgs
```### Targets
#### Go Namespace
`go:checkVersion` - Asserts that the version is use is the version specified. If the version specified ends in `.x` or only has two parts (`go1.13`) it is expanded to the most recent patch version of that go release. Modify the version by specifying `gons.Version` in your magefile.
`go:cover` - Generate cover file. Modify the arguments by specifying `gons.CoverArgs` in your magefile.
`go:coverage` - Generates coverage information and opens it in your browser. Modify the arguments by specifying `gons.CoverArgs` in your magefile.
`go:test` - Runs go test. Modify the arguments by specifying `gons.TestArgs` in your magefile.
#### Tool Namespace
`golangclilint:remove` - Removes all cached versions of golangci-lint.
`golangcilint:run` - Runs golangci-lint. Modify the arguments by specifying `toolns.GolangciLint.RunArgs` and change the version by specifying `toolns.GolangciLint.Version` in your magefile.