Skip to content

Commit

Permalink
ci: update go version, mage action and tool versions (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
princjef committed Jul 2, 2021
1 parent eec5d3c commit 704cd48
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 30 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ jobs:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Lint
uses: crazy-max/ghaction-mage@v1
uses: magefile/mage-action@v1
with:
version: 1.9.0
version: latest
args: lint
- name: Doc Verify
uses: crazy-max/ghaction-mage@v1
uses: magefile/mage-action@v1
with:
version: 1.9.0
version: latest
args: docVerify
- name: Test
uses: crazy-max/ghaction-mage@v1
uses: magefile/mage-action@v1
with:
version: 1.9.0
version: latest
args: test
16 changes: 7 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
linters:
enable:
- bodyclose
- golint
- unconvert
- gochecknoinits
- gocritic
- gocyclo
- goimports
- maligned
- misspell
- govet
- lll
- gocritic
- gochecknoinits
- misspell
- revive
- unconvert

linters-settings:
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
lll:
tab-width: 4
nakedret:
max-func-lines: 10
golint:
revive:
min-confidence: 0.5

issues:
Expand Down
24 changes: 12 additions & 12 deletions bintool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ If your archive and/or binary files use different extensions than the default on
- [func WithVersionCmd(cmd string) Option](<#func-withversioncmd>)


## type [BinTool](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L32-L37>)
## type [BinTool](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L33-L38>)

BinTool represents a single binary tool/version combination with the information needed to check and/or install the tool if desired\.

Expand All @@ -111,15 +111,15 @@ type BinTool struct {
}
```

### func [Must](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L55>)
### func [Must](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L56>)

```go
func Must(t *BinTool, err error) *BinTool
```

Must provides a utility for asserting that methods returning a BinTool and an error have no error\. If there is an error\, this call will panic\.

### func [New](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L70>)
### func [New](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L71>)

```go
func New(command, version, url string, opts ...Option) (*BinTool, error)
Expand All @@ -129,23 +129,23 @@ New initializes a BinTool with the provided command\, version\, and download url

The command\, url\, and version command may all use text templates to define their formats\. If any of these templates fails to compile or evaluate\, this call will return an error\.

### func \(\*BinTool\) [Command](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L180>)
### func \(\*BinTool\) [Command](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L181>)

```go
func (t *BinTool) Command(args string) shellcmd.Command
```

Command generates a runnable command using this binary tool along with the provided args\.

### func \(\*BinTool\) [Ensure](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L170>)
### func \(\*BinTool\) [Ensure](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L171>)

```go
func (t *BinTool) Ensure() error
```

Ensure checks to see if a valid version of the tool is installed\, and downloads/installs it if it isn't already\.

### func \(\*BinTool\) [Install](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L150>)
### func \(\*BinTool\) [Install](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L151>)

```go
func (t *BinTool) Install() error
Expand All @@ -155,47 +155,47 @@ Install unconditionally downloads and installs the tool to the configured folder

If you don't want to download the tool every time\, you may prefer Ensure\(\) instead\.

### func \(\*BinTool\) [IsInstalled](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L119>)
### func \(\*BinTool\) [IsInstalled](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L120>)

```go
func (t *BinTool) IsInstalled() bool
```

IsInstalled checks whether the correct version of the tool is currently installed as defined by the version command\.

## type [Option](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L50>)
## type [Option](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L51>)

Option configures a BinTool with optional settings

```go
type Option func(t *BinTool) error
```

### func [WithArchiveExt](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L197>)
### func [WithArchiveExt](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L198>)

```go
func WithArchiveExt(ext string) Option
```

WithArchiveExt defines a custom extension to use when identifying an archive via the ArchiveExt template variable\. The default archive extension is \.tar\.gz except for Windows\, where it is \.zip\.

### func [WithBinExt](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L207>)
### func [WithBinExt](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L208>)

```go
func WithBinExt(ext string) Option
```

WithBinExt defines a custom extension to use when identifying a binary executable via the BinExt template variable\. The default binary extension is empty for all operating systems except Windows\, where it is \.exe\.

### func [WithFolder](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L187>)
### func [WithFolder](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L188>)

```go
func WithFolder(folder string) Option
```

WithFolder defines a custom folder path where the tool is expected to exist and where it should be installed if desired\. Paths will be normalized to the operating system automatically\, so unix\-style paths are recommended\.

### func [WithVersionCmd](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L220>)
### func [WithVersionCmd](<https://github.com/princjef/mageutil/blob/master/bintool/bintool.go#L221>)

```go
func WithVersionCmd(cmd string) Option
Expand Down
4 changes: 2 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
var (
linter = bintool.Must(bintool.New(
"golangci-lint{{.BinExt}}",
"1.23.6",
"1.41.1",
"https://github.com/golangci/golangci-lint/releases/download/v{{.Version}}/golangci-lint-{{.Version}}-{{.GOOS}}-{{.GOARCH}}{{.ArchiveExt}}",
))
documenter = bintool.Must(bintool.New(
"gomarkdoc{{.BinExt}}",
"0.1.0-beta.9",
"0.2.1",
"https://github.com/princjef/gomarkdoc/releases/download/v{{.Version}}/gomarkdoc_{{.Version}}_{{.GOOS}}_{{.GOARCH}}{{.ArchiveExt}}",
))
)
Expand Down

0 comments on commit 704cd48

Please sign in to comment.