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
6 changes: 3 additions & 3 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@master
with:
go-version: "1.20"
go-version: "1.24"

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@master

- name: golangci-lint
uses: golangci/golangci-lint-action@master
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@master
with:
go-version: "1.20"
go-version: "1.24"

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@master

- name: golangci-lint
uses: golangci/golangci-lint-action@master
with:
version: latest
args: --issues-exit-code=0
args: --issues-exit-code=0 --timeout=10m
- name: Commit back
continue-on-error: true
run: |
Expand Down
15 changes: 6 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
linters-settings:
errcheck:
ignore: fmt:.*
ignoretests: true

goimports:
Expand All @@ -18,11 +17,10 @@ linters:
fast: false
enable:
- bodyclose
#- deadcode
#- depguard
- dogsled
- errcheck
- exportloopref
#- exportloopref
- exhaustive
#- funlen
#- goconst
Expand All @@ -39,13 +37,11 @@ linters:
- nolintlint
- rowserrcheck
- staticcheck
#- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
#- varcheck
- whitespace
- prealloc
- predeclared
Expand All @@ -57,22 +53,23 @@ linters:
run:
# default concurrency is a available CPU number.
# concurrency: 4 # explicitly omit this value to fully utilize available resources.
deadline: 5m
deadline: 15m
issues-exit-code: 1
tests: false
go: '1.20'
go: '1.24'

# output configuration options
output:
formats:
- format: "colored-line-number"
print-issued-lines: true
print-linter-name: true
uniq-by-line: true

issues:
# Fix found issues (if it's supported by the linter)
fix: true
exclude-use-default: false
uniq-by-line: true
exclude:
- "Error return value of .((os.)?std(out|err)..*|.*Close|.*Seek|.*Flush|os.Remove(All)?|.*print(f|ln)?|os.(Un)?Setenv). is not check"
- "Error return value of .((os.)?std(out|err)..*|.*Close|.*Seek|.*Flush|os.Remove(All)?|.*print(f|ln)?|os.(Un)?Setenv). is not check"
- 'identifier ".*" contain non-ASCII character: U\+.*'
8 changes: 5 additions & 3 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ func (m *Control[CTX]) SetData(groupID int64, data int64) error {
c.Disable = 1
}
}
// c.Disable: Fxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxD
x := bits.RotateLeft64(uint64(c.Disable), 1)
x &= 0x03
x |= uint64(data) << 2
c.Disable = int64(bits.RotateLeft64(x, -1))
// x : xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxDF
x &= 0x02 // mask DF
x |= uint64(data) << 2 // combine with data
c.Disable = int64(bits.RotateLeft64(x, -1)) // rotate back
log.Debugf("[control] set plugin %s of grp %d : 0x%x", m.Service, c.GroupID, data)
m.Manager.Lock()
err = m.Manager.D.Insert(m.Service, &c)
Expand Down
Loading