Open mcarifio opened 2 years ago
like this:
exec cd chapter2/sample && go mod init main
/chapter2/sample/go.mod
module main
go 1.21
modify import
> /chapter2/sample/main.go
``` golang
import (
"log"
"os"
_ "main/matchers"
"main/search"
)
modify import
/chapter2/sample/matchers/rss.go
import ( "encoding/xml" "errors" "fmt" "log" "main/search" "net/http" "regexp" )
finally, run go run main.go
go.mod appears to be needed to compile the chapter2 sample, at least without downloading matchers and search independently in ways I don't yet understand. So figured out how to
replace
the imports inmain.go
with local directories mostly through examples and cut and paste. I don't exactly know what I'm doing, but I'll let you cherrypick what changes you want, if any.