Skip to content

Commit

Permalink
Upgrade yaml and CI (#5)
Browse files Browse the repository at this point in the history
* Upgrade yaml and CI
  • Loading branch information
milosgajdos authored May 28, 2022
1 parent a348b1f commit 8170a0f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
go: [ '1.14', '1.15' ]
go: [ '1.17', '1.18' ]

steps:

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
go: [ '1.14', '1.15' ]
go: [ '1.17', '1.18' ]

steps:

Expand All @@ -75,4 +75,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: v1.33
version: v1.46
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
linters:
enable:
- structcheck
- varcheck
- staticcheck
- unconvert
- gofmt
- ineffassign
- vet
- unused
- misspell
- bodyclose
- errcheck
- goimports
- prealloc

run:
deadline: 2m
skip-dirs:
- vendor
10 changes: 8 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
module github.com/milosgajdos/gopfield

go 1.14
go 1.17

require (
github.com/stretchr/testify v1.6.1
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect
gonum.org/v1/gonum v0.8.2
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6d
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
6 changes: 3 additions & 3 deletions hopfield/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ func TestStore(t *testing.T) {

data := []float64{1.0, -1.0}
v := mat.NewVecDense(len(data), data)
patterns = []*Pattern{&Pattern{v: v}}
patterns = []*Pattern{{v: v}}
errString = "invalid pattern dimension: %d"
err = n.Store(patterns)
assert.EqualError(err, fmt.Sprintf(errString, patterns[0].Len()))

data = []float64{1.0, -1.0, -1.0, 1.0}
v = mat.NewVecDense(len(data), data)
patterns = []*Pattern{&Pattern{v: v}}
patterns = []*Pattern{{v: v}}
err = n.Store(patterns)
assert.NoError(err)
assert.Equal(n.Weights().At(0, 3), n.Weights().At(3, 0))
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestRestore(t *testing.T) {

data := []float64{1.0, -1.0, -1.0, 1.0}
v := mat.NewVecDense(len(data), data)
patterns := []*Pattern{&Pattern{v: v}}
patterns := []*Pattern{{v: v}}
err = n.Store(patterns)
assert.NoError(err)

Expand Down

0 comments on commit 8170a0f

Please sign in to comment.