9. Go Packages Continued

Let's use our new mystrings package in hellogo.

Assignment

1

Modify hellogo's main.go

package main

import (
	"fmt"

	"{REMOTE}/{USERNAME}/mystrings"
)

func main() {
	fmt.Println(mystrings.Reverse("hello world"))
}
2

Update hellogo's go.mod to use the local mystrings

module example.com/username/hellogo

go 1.25.1

replace example.com/username/mystrings v0.0.0 => ../mystrings

require example.com/username/mystrings v0.0.0

../mystrings tells go to look in the parent directory of hellogo for the mystrings sibling directory.

3

Build and run the program

go build
./hellogo
circle-info

Run and submit the CLI tests from the root of the main package.

![[{F19B7899-8C99-4A7E-BD3B-23A4241014DE}.png]]

![[{8C29D016-494E-4CE8-BED0-15805815B975}.png]]