A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go

Adds linter #3

closed
opened by cuducos.me targeting main from cuducos.me/at-container-registry: golangci-lint

Following the convo in #2 this PR suggests:

  • Fixes to all golangci-lint issues
  • Adding golangci-lint to the CI to assure consistency moving forward
0
by cuducos.me 4 comments
expand 1 commit
Adds linter

Thanks. this will take a bit to comb through.

Sure thing! It is a lot of changes : ) Happy to follow up wherever needed.

I appreciate the work, but I think this would have been better done in chunks. I'm trying to lint some of the obvious ones you found but I don't think I can merge this PR as is.

Currently there are a few bugs from the refactor: Logic Inversion in Version Check - cmd/credential-helper/main.go:714-721

  shouldUpdate, err := isNewerVersion(versionInfo.Latest, version)
  if err != nil {
      return err
  }
  if shouldUpdate {  // ← BUG: true means newer IS available
      fmt.Printf("You're already running the latest version (%s)\n", version)
      return nil
  }

WriteHeader Order Bug - pkg/appview/handlers/images.go:103-107

  w.Header().Set("Content-Type", "application/json")
  resp := map[string]any{...}
  if err := json.NewEncoder(w).Encode(resp); err != nil {
      slog.Error("failed to write response", "error", err)
      w.WriteHeader(http.StatusInternalServerError)
  }
  w.WriteHeader(http.StatusConflict)  // ← BUG: ALWAYS called, after body!

pkg/hold/oci/xrpc_test.go imports slog, which shouldn't be added to test files.

There are more issues, I wish i could inline-comment here like on github.

I think this would have been better done in chunks.

That is reasonable! Closed this one, I'll get another approach started in the next PR. Let's get it done in a non-disruptive way ; )

closed without merging
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:3272gdrjsuikiff7qsgokgas/sh.tangled.repo.pull/3mbl342vchj22