Well, I figured out the problem.
Basically Go starting path for import is $HOME/go/src
So I just needed to add myapp
in front of the package names, that is, the import should be:
import (
"log"
"net/http"
"myapp/common"
"myapp/routers"
)
More Related Contents:
- Create a generic channel
- How to pipe several commands in Go?
- How to use a module that is outside of “GOPATH” in another module?
- slice of struct != slice of interface it implements?
- How can I convert string to integer in golang
- How to dump goroutine stacktraces?
- Does Go compiler’s evaluation differ for constant expression and other expression
- Accessing struct fields inside a map value (without copying)
- Why do I get a “cannot assign” error when setting value to a struct as a value in a map? [duplicate]
- Can I concurrently write different slice elements
- Organize local code in packages using Go modules
- How can I pass a slice as a variadic input?
- Does Go provide REPL?
- How to compare if two structs, slices or maps are equal?
- Golang defer behavior
- Stack vs heap allocation of structs in Go, and how they relate to garbage collection
- Is unnamed arguments a thing in Go?
- How to fix parsing go.mod module declares its path as “x” but was required as “y”
- What is the meaning of “dot parenthesis” syntax? [duplicate]
- What is the idiomatic Go equivalent of C’s ternary operator?
- Can I construct a slice of a generic type with different type parameters?
- How to delete an element from a Slice in Golang
- Does the Go language have function/method overloading?
- Go: panic: runtime error: invalid memory address or nil pointer dereference
- Go struct tags with underscore before function names
- Function declaration syntax: things in parenthesis before function name
- How to import local packages without gopath
- Difference between any/interface{} as constraint vs. type of argument?
- Streaming commands output progress
- Slice chunking in Go