confusing compile error message after renaming module

216 views
Skip to first unread message

DrGo

unread,
Jan 17, 2021, 11:14:36 PM1/17/21
to golang-nuts
Wondering if someone knows what is going on here:

I renamed a module in go.mod from liverserver [sic] to gols and imported it in main.go in a "cmd" subdir. Now I am getting this error when I compile main.go: 

./main.go:8:2: imported and not used: "github.com/drgo/gols" as liverserver
./main.go:13:12: undefined: gols
./main.go:60:12: undefined: gols 

These are the lines referred to in the compiler output above

import (
)

var config gols.Config  

if err :=gols.Serve(&config); err!= nil {  


go mod tidy and go go clean -cache -modcache -i -r did not make a difference.

why the compiler still wants to import gols as liverserver

I am using  go1.16beta1 darwin/amd64

Thanks,



DrGo

unread,
Jan 17, 2021, 11:21:59 PM1/17/21
to golang-nuts
Of course, once you post about a problem, you immediately figure it out.
I forgot to update the go files in the package folder to reflect the name change
package liverserver--> package gols fixes the issue.
Reply all
Reply to author
Forward
0 new messages