Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ on:
workflow_dispatch:

jobs:
lint:
name: "Lint"
if: "${{ !endsWith(github.actor, '[bot]') }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: projectdiscovery/actions/setup/go@v1
- uses: projectdiscovery/actions/golangci-lint@v1

build:
name: Test Builds
needs: ["lint"]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/lint-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ml/model_selection/model_selection.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package modelselection

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

func TrainTestSplit(dataset []interface{}, testSize float64) (train, test []interface{}) {
Expand Down
4 changes: 2 additions & 2 deletions rand/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/rand"
"errors"
"math/big"
crand "math/rand"
crand "math/rand/v2"
)

// IntN returns a uniform random value in [0, max). It errors if max <= 0.
Expand All @@ -14,7 +14,7 @@ func IntN(max int) (int, error) {
}
nBig, err := rand.Int(rand.Reader, big.NewInt(int64(max)))
if err != nil {
return crand.Intn(max), nil
return crand.IntN(max), nil
}
return int(nBig.Int64()), nil
}
2 changes: 1 addition & 1 deletion regexp/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func compileWithRE2(pattern string) (*Regexp, error) {
os.Stderr = devNull
defer func() {
os.Stderr = originalStderr
devNull.Close()
_ = devNull.Close()
}()
}

Expand Down
4 changes: 2 additions & 2 deletions slice/sliceutil.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sliceutil

import (
"math/rand"
"math/rand/v2"
"strconv"
"time"

Expand Down Expand Up @@ -61,7 +61,7 @@ func DedupeFunc[T any](inputSlice []T, keyFunc func(T) any) (result []T) {

// PickRandom item from a slice of elements
func PickRandom[T any](v []T) T {
return v[rand.Intn(len(v))]
return v[rand.IntN(len(v))]
}

// Contains if a slice contains an element
Expand Down
Loading