Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/guardian/coding-exercise-project/go

go 1.21
8 changes: 6 additions & 2 deletions go/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package main

import "./src"
import (
"fmt"

"github.com/guardian/coding-exercise-project/go/src"
)

func main() {
println(pairing.SayHello())
fmt.Println(pairing.SayHello())
}
8 changes: 3 additions & 5 deletions go/script/test
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

pushd src
cd "$(dirname "${BASH_SOURCE[0]}")/.."

go test

popd
go test ./...
2 changes: 1 addition & 1 deletion go/src/pairing.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package pairing

func SayHello() string {
return "hi"
return "hello"
}
10 changes: 3 additions & 7 deletions go/src/pairing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ package pairing

import "testing"

func TestNothing(t *testing.T) {
t.Skip("no implemented")
}

func TestSimpleString(t *testing.T) {
if SayHello() != "hello" {
t.Error("couldn't get hello message")
}
if SayHello() != "hello" {
t.Error("couldn't get hello message")
}
}