From 704cd482497f5862fdc9b3892f3299096127fca1 Mon Sep 17 00:00:00 2001 From: Jeff Principe Date: Fri, 2 Jul 2021 11:02:24 -0700 Subject: [PATCH] ci: update go version, mage action and tool versions (#4) --- .github/workflows/test.yml | 14 +++++++------- .golangci.yml | 16 +++++++--------- bintool/README.md | 24 ++++++++++++------------ magefile.go | 4 ++-- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6437861..0a75a13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/.golangci.yml b/.golangci.yml index 51955be..bcfec72 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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: diff --git a/bintool/README.md b/bintool/README.md index b3ca43e..168cd39 100755 --- a/bintool/README.md +++ b/bintool/README.md @@ -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]() +## type [BinTool]() BinTool represents a single binary tool/version combination with the information needed to check and/or install the tool if desired\. @@ -111,7 +111,7 @@ type BinTool struct { } ``` -### func [Must]() +### func [Must]() ```go func Must(t *BinTool, err error) *BinTool @@ -119,7 +119,7 @@ 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]() +### func [New]() ```go func New(command, version, url string, opts ...Option) (*BinTool, error) @@ -129,7 +129,7 @@ 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]() +### func \(\*BinTool\) [Command]() ```go func (t *BinTool) Command(args string) shellcmd.Command @@ -137,7 +137,7 @@ 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]() +### func \(\*BinTool\) [Ensure]() ```go func (t *BinTool) Ensure() error @@ -145,7 +145,7 @@ 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]() +### func \(\*BinTool\) [Install]() ```go func (t *BinTool) Install() error @@ -155,7 +155,7 @@ 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]() +### func \(\*BinTool\) [IsInstalled]() ```go func (t *BinTool) IsInstalled() bool @@ -163,7 +163,7 @@ 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]() +## type [Option]() Option configures a BinTool with optional settings @@ -171,7 +171,7 @@ Option configures a BinTool with optional settings type Option func(t *BinTool) error ``` -### func [WithArchiveExt]() +### func [WithArchiveExt]() ```go func WithArchiveExt(ext string) Option @@ -179,7 +179,7 @@ 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]() +### func [WithBinExt]() ```go func WithBinExt(ext string) Option @@ -187,7 +187,7 @@ 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]() +### func [WithFolder]() ```go func WithFolder(folder string) Option @@ -195,7 +195,7 @@ 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]() +### func [WithVersionCmd]() ```go func WithVersionCmd(cmd string) Option diff --git a/magefile.go b/magefile.go index 865701d..136e81a 100644 --- a/magefile.go +++ b/magefile.go @@ -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}}", )) )