import (
a "math"
b "project/math"
)
is ok, a problem occurs in the .go files implementing my math package.
They use Go's math, and so they have to start like this:
package math
import "math"
which causes a compiler error "package cannot import itself".
Does anyone have an elegant work-around? I suppose I am
trying to avoid re-basing the Go library, which would
result in using a non-standard install of Go. This is probably
not a desirable feature to persist.
Thanks,
--Petar
import "math" is the same as import math "math", which I would expect
to fail in package math. The problem I have is that the following
fails too.
package math
import gomath "math"
func main() {
const pi = gomath.Pi
}
Peter
Does anyone have an elegant work-around? I suppose I am
trying to avoid re-basing the Go library, which would
result in using a non-standard install of Go. This is probably
not a desirable feature to persist.