Skip to content

go: Fix build: add go.mod, proper imports, and make test pass - #162

Open
adamnfish-gu wants to merge 1 commit into
mainfrom
fix/go
Open

adamnfish-gu wants to merge 1 commit into
mainfrom
fix/go

Conversation

@adamnfish-gu

@adamnfish-gu adamnfish-gu commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

The project did not build:

  • No go.mod, so the GOPATH-era relative import "./src" in main.go was rejected.
  • SayHello() returned "hi" but TestSimpleString expected "hello".

Adds go.mod with module path github.com/guardian/coding-exercise-project/go, switches main.go to the module-qualified import, and returns "hello" from SayHello(). script/test runs go test ./... from the module root rather than pushd src && go test.

Removes TestNothing, a t.Skip stub. Replaces the println builtin, which writes to stderr, with fmt.Println.


Base platform/tool-versions-ci (#144), so the diff shows only this branch's changes. Merge #144 first.

Part of #143.

The project did not build:
- No go.mod, so the GOPATH-era relative import "./src" in main.go was
  rejected.
- SayHello() returned "hi" but TestSimpleString expected "hello".

Adds go.mod with module path github.com/guardian/coding-exercise-project/go,
switches main.go to the module-qualified import, and returns "hello" from
SayHello(). script/test runs `go test ./...` from the module root rather than
`pushd src && go test`.

Removes TestNothing, a t.Skip stub. Replaces the println builtin, which
writes to stderr, with fmt.Println.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adamnfish-gu adamnfish-gu reopened this Oct 9, 2026
Base automatically changed from platform/tool-versions-ci to main October 19, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant