Skip to content

Commit

Permalink
all: upgrade to golangci-lint v1.49.0 (#329)
Browse files Browse the repository at this point in the history
Fixes #242
  • Loading branch information
mmcloughlin authored Sep 6, 2022
1 parent d76a0f6 commit e788b76
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 438 deletions.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ linters:
enable-all: true
disable:
- cyclop
- deadcode
- errname
- exhaustruct
- exhaustivestruct
- forbidigo
- forcetypeassert
Expand All @@ -22,12 +24,16 @@ linters:
- lll
- maligned
- nlreturn
- nonamedreturns
- nosnakecase
- paralleltest
- prealloc
- scopelint
- structcheck
- tagliatelle
- testpackage
- unparam
- varcheck
- varnamelen
- wrapcheck
- wsl
Expand Down
5 changes: 2 additions & 3 deletions attr/make_textflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"go/format"
"io"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -107,7 +106,7 @@ func DownloadGoSourceFile(outpath, v, srcpath string) (err error) {
return err
}

if err := ioutil.WriteFile(outpath, buf.Bytes(), 0o644); err != nil {
if err := os.WriteFile(outpath, buf.Bytes(), 0o644); err != nil {
return err
}

Expand Down Expand Up @@ -169,7 +168,7 @@ func Parse(r io.Reader) ([]Flag, error) {

// ParseFile parses text flags header file.
func ParseFile(filename string) ([]Flag, error) {
b, err := ioutil.ReadFile(filename)
b, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions buildtags/buildtags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//
// Any terms provided in the filename can be thought of as an implicit extra
// constraint comment line. Collectively, these are referred to as
// ``constraints''. Each line is a ``constraint''. Within each constraint the
// space-separated terms are ``options'', and within that the comma-separated
// items are ``terms'' which may be negated with at most one exclaimation mark.
// constraints. Each line is a constraint. Within each constraint the
// space-separated terms are options, and within that the comma-separated
// items are terms which may be negated with at most one exclaimation mark.
//
// These represent a boolean formulae. The constraints are evaluated as the AND
// of constraint lines; a constraint is evaluated as the OR of its options and
Expand Down
1 change: 0 additions & 1 deletion gotypes/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (c *component) Dereference(r reg.Register) Component {
// Len int
// Cap int
// }
//
var slicehdroffsets = Sizes.Offsetsof([]*types.Var{
types.NewField(token.NoPos, nil, "Data", types.Typ[types.Uintptr], false),
types.NewField(token.NoPos, nil, "Len", types.Typ[types.Int], false),
Expand Down
7 changes: 3 additions & 4 deletions internal/cmd/docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"math"
"net/url"
Expand Down Expand Up @@ -84,7 +83,7 @@ func mainerr() (err error) {

// Output.
if *output != "" {
err = ioutil.WriteFile(*output, body, 0o640)
err = os.WriteFile(*output, body, 0o640)
} else {
_, err = os.Stdout.Write(body)
}
Expand All @@ -103,7 +102,7 @@ var templates embed.FS
func load() (string, error) {
// Prefer explicit filename, if provided.
if *tmpl != "" {
b, err := ioutil.ReadFile(*tmpl)
b, err := os.ReadFile(*tmpl)
if err != nil {
return "", err
}
Expand All @@ -125,7 +124,7 @@ func load() (string, error) {

// include template function.
func include(filename string) (string, error) {
b, err := ioutil.ReadFile(filename)
b, err := os.ReadFile(filename)
if err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/inst/table_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package inst_test

import (
"io/ioutil"
"os"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -187,7 +187,7 @@ func TestInstructionArities(t *testing.T) {
}

func TestStdLibOpcodes(t *testing.T) {
b, err := ioutil.ReadFile("testdata/stdlibopcodes.txt")
b, err := os.ReadFile("testdata/stdlibopcodes.txt")
if err != nil {
t.Fatal(err)
}
Expand Down
Loading

0 comments on commit e788b76

Please sign in to comment.