package util
func Abs(x int) int {
if x < 0 {
return -x
} else {
return x
}
}
And the problem appears when I try to use the package util (in the root directory of the module) within another package of the module...
package main
import (
"fmt"
"a_module_path/util" // this doesn't works
"a_module_path/../util" // this attemp neither (and as relative import paths are not supported in module mode i guess is a no-go)
)
func main() {
fmt.Println(util.Abs(-2))
}
The question, as you may predict, is
¿If there any way to make this work?I do not want to create a folder named util (or whatever) and place there the util package.
Thanks for the reading and the patience!
Keep rocking code!