Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies including Go version and actions #13

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -23,12 +23,12 @@ jobs:
- go
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
15 changes: 6 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -16,26 +16,23 @@ jobs:
fail-fast: false
matrix:
go-version:
- 1.17
- 1.13
- '1.21'
- '1.20'
steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Set up Staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
if: ${{ matrix.go-version != '1.13' }}
- name: Set up Staticcheck (Go v1.13)
run: GO111MODULE=on go get -u honnef.co/go/tools/cmd/[email protected]
if: ${{ matrix.go-version == '1.13' }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Vet
run: go vet -v ./...
- name: Staticcheck
run: staticcheck ./...
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -cover ./...
run: go test -v -cover -race -count=3 ./...
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/joeycumines/go-behaviortree

go 1.13
go 1.20

require (
github.com/go-test/deep v1.1.0
github.com/joeycumines/go-bigbuff v1.15.0
github.com/xlab/treeprint v1.1.0
github.com/joeycumines/go-bigbuff v1.15.1
github.com/xlab/treeprint v1.2.0
)
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -3,16 +3,15 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/joeycumines/go-bigbuff v1.15.0 h1:EZ41f9bQhRQVFUyQXwhMNe7jLSeNuk9dHwrMX0NWDNA=
github.com/joeycumines/go-bigbuff v1.15.0/go.mod h1:7hqtGnMDT3v+yOvHUb+hx+JSxhlTF2W9BGIkvNQizaA=
github.com/joeycumines/go-bigbuff v1.15.1 h1:lJNsoghg7Kh5HGfCs8/FFaGls/B669y9Vydt5byB4jQ=
github.com/joeycumines/go-bigbuff v1.15.1/go.mod h1:7hqtGnMDT3v+yOvHUb+hx+JSxhlTF2W9BGIkvNQizaA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk=
github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
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=
4 changes: 3 additions & 1 deletion shuffle.go
Original file line number Diff line number Diff line change
@@ -16,7 +16,9 @@

package behaviortree

import "math/rand"
import (
"math/rand"
)

// Shuffle implements randomised child execution order via encapsulation, using the provided source to shuffle the
// children prior to passing through to the provided tick (a nil source will use global math/rand), note that this
6 changes: 3 additions & 3 deletions shuffle_test.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ import (
)

func ExampleShuffle() {
rand.Seed(1231244)
randSource := rand.NewSource(1231244)
var (
newPrintlnFn = func(fn func() []interface{}) Tick {
return func([]Node) (Status, error) {
@@ -45,7 +45,7 @@ func ExampleShuffle() {
}
}())),
New(
Shuffle(Sequence, nil),
Shuffle(Sequence, randSource),
New(newPrintln(`node 1`)),
New(newPrintln(`node 2`)),
New(
@@ -61,7 +61,7 @@ func ExampleShuffle() {
}
}()),
New(
Shuffle(Selector, nil),
Shuffle(Selector, randSource),
New(newPrintln(`node 3`)),
New(newPrintln(`node 4`)),
New(newPrintln(`node 5`)),
2 changes: 1 addition & 1 deletion value_test.go
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ func TestNode_Value_race(t *testing.T) {

func nn(tick Tick, children ...Node) Node { return func() (Tick, []Node) { return tick, children } }

//noinspection GoNilness
// noinspection GoNilness
func TestNode_Value_simple(t *testing.T) {
type k1 struct{}
type k2 struct{}