diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index a4c0f8f..5970b93 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -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 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 70c0eda..d5fe6cf 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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: | diff --git a/.golangci.yml b/.golangci.yml index 943e1ef..e2f1995 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,5 @@ linters-settings: errcheck: - ignore: fmt:.* ignoretests: true goimports: @@ -18,11 +17,10 @@ linters: fast: false enable: - bodyclose - #- deadcode #- depguard - dogsled - errcheck - - exportloopref + #- exportloopref - exhaustive #- funlen #- goconst @@ -39,13 +37,11 @@ linters: - nolintlint - rowserrcheck - staticcheck - #- structcheck - stylecheck - typecheck - unconvert - unparam - unused - #- varcheck - whitespace - prealloc - predeclared @@ -57,10 +53,10 @@ 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: @@ -68,11 +64,12 @@ output: - 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" \ No newline at end of file + - "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\+.*' diff --git a/data.go b/data.go index d3c7185..52e5cd4 100644 --- a/data.go +++ b/data.go @@ -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)