[Golang]$ mkdir fourier
[Golang]$ cd fourier
[fourier]$
[fourier]$ go mod init example.com/fourier
go: creating new go.mod: module example.com/fourier
[fourier]$ ls
go.mod
[fourier]$ touch main.go
{
"name": "fourier",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node main.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
# ensure you are in root folder, fourier
go run .
[fourier]$ mkdir hello
[fourier]$ touch hello/hello.go
[fourier]$ ls *
go.mod main.go
hello:
hello.go
[fourier]$ cd hello
[hello]$ ls
hello.go
[hello]$ go mod init example.com/fourier/hello
go: creating new go.mod: module example.com/fourier/hello
go: to add module requirements and sums:
go mod tidy
[hello]$ cd ../
[fourier]$ go mod edit -replace example.com/fourier/hello=./hello
[fourier]$ cat go.mod
module example.com/fourier
go 1.18
replace example.com/fourier/hello => ./hello
[fourier]$
[fourier]$ go mod tidy
go: found example.com/fourier/hello in example.com/fourier/hello v0.0.0-00010101000000-000000000000
[fourier]$ go run .
Hello world
Architecture: darwin
[fourier]$