Skip to content

Commit cadd395

Browse files
committed
chore: require Go 1.22+
1 parent 64b1b2c commit cadd395

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
fail-fast: false
5757
matrix:
5858
include:
59-
- { go: "1.12" }
60-
- { go: "1.17" }
61-
- { go: "1.18" }
59+
- { go: "1.22" }
60+
- { go: "1.24" }
61+
- { go: "1.26" }
6262
- { go: "^1", coverage: true }
6363
steps:
6464
- uses: actions/checkout@v6

fuzz.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build gofuzz
2-
// +build gofuzz
32

43
package robotstxt
54

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
module github.com/temoto/robotstxt
22

3-
go 1.12
3+
go 1.22
44

55
require github.com/stretchr/testify v1.3.0
6+
7+
require (
8+
github.com/davecgh/go-spew v1.1.0 // indirect
9+
github.com/pmezard/go-difflib v1.0.0 // indirect
10+
)

scanner.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"go/token"
77
"os"
8+
"slices"
89
"sync"
910
"unicode/utf8"
1011
)
@@ -22,7 +23,7 @@ type byteScanner struct {
2223
const tokEOL = "\n"
2324

2425
var WhitespaceChars = []rune{' ', '\t', '\v'}
25-
var tokBuffers = sync.Pool{New: func() interface{} { return bytes.NewBuffer(make([]byte, 32)) }}
26+
var tokBuffers = sync.Pool{New: func() any { return bytes.NewBuffer(make([]byte, 32)) }}
2627

2728
func newByteScanner(srcname string, quiet bool) *byteScanner {
2829
return &byteScanner{
@@ -136,12 +137,7 @@ func (s *byteScanner) isEol() bool {
136137
}
137138

138139
func (s *byteScanner) isSpace() bool {
139-
for _, r := range WhitespaceChars {
140-
if s.ch == r {
141-
return true
142-
}
143-
}
144-
return false
140+
return slices.Contains(WhitespaceChars, s.ch)
145141
}
146142

147143
func (s *byteScanner) skipSpace() {

0 commit comments

Comments
 (0)