Conversation
- drop duplicate encoding/hex import alias enchex - replace deprecated io/ioutil import with io - migrate deprecated go-ntlmssp ProcessChallenge/ProcessChallengeWithHash/GetDomain to NewAuthenticateMessage - cleanup switch syntax
- simplify pkt.Identifier.Tag to pkt.Tag via embedded promotion - make ControlServerSideSortingResult receiver names consistent - fix doc comment form on some types - cleanup switch syntax
- ldap.go: replace deprecated io/ioutil with os.ReadFile; tidy up switch statement syntax
- search.go: use any in lieu of interface{}, reflect.Ptr -> reflect.Pointer, tidy up doc comment
- debug.go: use any in lieu of interface{}
- gssapi/client.go: drop redundant embedded Client selector
- examples_test.go: replace deprecated io/ioutil with os.ReadFile - search_test.go: use range syntax instaed of manual loop - error_test.go: rename panic_data to panicData per ST1003, drop redundant tt copy (no longer needed since go1.22)
The Client receiver was named client and the constructors bound locals named client and keytab, so calls like client.Destroy() read as package calls. InitSecContextWithOptions returned !false in the KRBError branch, while the sibling branch returns a plain true. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
golint is deprecated and frozen (golang/go#38968). The target runs staticcheck in v3/ because the repository root holds no module. staticcheck does not read //nolint directives, so the md4 import needs its own //lint:ignore; the //nolint one stays for golangci-lint in CI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The module lives in v3/, so go get/build/vet/test at the repository root failed with "directory prefix . does not contain main module". CI never hit this because it cd's into v3/ itself. Also drop the duplicated test entry in .PHONY and add the missing targets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
go test . covered only v3, so the regression test for the UnmarshalWrapToken offset overflow (go-ldap#602) in v3/gssapi has never run. The CI workflow skipped the same package, and so did go vet and go build there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No concerns from me - however we can land my (admittedly small) improvements works for me :-) A suggestion - I assume most people use VSCode for development, would it be an opportune time to add a shared |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This picks up @rc4's work in #608 and adds four follow-up commits.
All five of @rc4's commits are preserved here with their original authorship; the staticcheck cleanup itself is entirely their work.
@rc4, if you would rather keep #608 and pull these follow-ups into it, say so and I will close this one.
What comes from #608 (@rc4)
At the merge base,
staticcheck ./...reports the following inv3. After #608 it reports nothing.io/ioutil→io/osntlmssp.ProcessChallenge,ProcessChallengeWithHashandGetDomain→NewAuthenticateMessageencoding/heximported twiceThe golangci-lint job also reports staticcheck's
QFchecks, which #608 clears as well: QF1002 (1), QF1003 (4), QF1006 (1) and QF1008 (4).Beyond that it fixes checks that are off by default (ST1016, ST1020, ST1021, and one ST1003 on a local in a test) and modernizes
interface{}→any,reflect.Ptr→reflect.Pointerand a counting loop tofor range 100.The three remaining ST1003 findings (
SyncInfoSyncIdSet,ControlSyncInfoSyncIdSet,SyncIdSet) are left alone on purpose, since they are exported and renaming them would break the API.What this PR adds
chore(gssapi): clean up shadowed identifiers and a !false returnThe
Clientreceiver was namedclient, and the constructors bound locals namedclientandkeytab. Both shadow the imported packages of the same name. After #608 applied QF1008,client.Client.Destroy()becameclient.Destroy(), which reads like a package-level call. Renaming the receiver tocand the locals toclandktremoves the ambiguity.The same file returned
!falsein theIsKRBErrorbranch, where the sibling branch returns a plaintrue.chore: replace golint with staticcheck in the lint targetmake lintran golint, which is deprecated and frozen (golang/go#38968). It now runsstaticcheck ./..., following the same change made in go-ldap/ldif#30. The shell wrapper that turned non-empty output into a failure is gone, since staticcheck exits non-zero on its own.Two adjustments were needed:
v3/, because the repository root holds nogo.mod.golang.org/x/crypto/md4carries a//nolint:staticcheckcomment, which only golangci-lint understands. A//lint:ignore SA1019was added beside it so that plain staticcheck stays quiet too. The//nolintone stays for CI.chore: run the Go targets inside the v3 moduleinstall,build,testandvetall ran at the repository root, wheregofails withdirectory prefix . does not contain main module. They now cd intov3/the wayfuzzandlintalready did, through aMODULE_DIRvariable..PHONYalso listedtesttwice and was missingfuzz,local-serverandstop-local-server.chore: run the tests in every package of the modulego test .covered onlyv3, so nothing ever ran the tests inv3/gssapi. That includes the regression test for theUnmarshalWrapTokenoffset overflow added in #602, where achecksumLabove 65519 wrapped theuint16offset and panicked the bind goroutine.The Makefile and
.github/workflows/pr.ymlnow use./..., which also makesgo vetandgo buildcover that package in CI.Notes for reviewers
GetLDAPErrorreturningEmpty packet. Callers comparing those strings will need updating.ProcessChallengeandProcessChallengeWithHashare//go:fix inlinewrappers whose bodies areexactly the new calls, and
ProcessChallengeignores thedomainNeededargument thatGetDomainproduced.Testing
make lint,make vet,make buildandmake fmtpass.make testnow compiles and runs both packages.v3/gssapipasses; thev3tests need a directory server frommake local-server.