Skip to content

Bug: Local dev is broken - TestHeaderBuilder fails on macOS, go vet errors, Makefile build bugs #25

Open

Description

@LinuxSuRen

Description

Several small items make local development noisy. All verified on master@a4ebe30 (go1.27, macOS):

  1. go test ./pkg/ -run TestHeaderBuilder fails on macOS: the test hardcodes chunk 60000 while HeaderBuilder.Build returns 9000 on darwin (pkg/header.go:96). The test needs to be platform-aware, or the chunk size should be injectable.

  2. go vet ./... fails:

    pkg/sender.go:60:45: address format "%s:%d" does not work with IPv6
    pkg/sender.go:125:48: address format "%s:%d" does not work with IPv6
    

    Use net.JoinHostPort (or &net.UDPAddr{IP: ..., Port: ...}) instead of fmt.Sprintf("%s:%d", ...).

  3. Makefile: CGO_ENABLE=0 is a typo for CGO_ENABLED=0 (all build targets).

  4. Makefile build-gui builds the same output path twice — the second build (without -H=windowsgui) overwrites the GUI build, so the flag never takes effect:

    build-gui:
    	CGO_ENABLE=0 GOOS=windows go build -ldflags -H=windowsgui -o bin/win/transfer-gui.exe ui/main.go
    	CGO_ENABLE=0 GOOS=windows go build -o bin/win/transfer-gui.exe ui/main.go
  5. Dead code: pkg/queue.go (Queue) and SafeMap.Get are referenced only from tests; also Queue.Size() reads len(q.data) without the lock while Push/Pop take it.

Expect

go build ./..., go vet ./... and go test ./... are clean on all three platforms, and make build-gui produces a real GUI binary.

The individual items are good-first-issue sized.

Activity

  1. added
    bug
    good first issue
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions