When exporting a binary, the path must be a directory name or an absolute path. Using the . throw an error.
Error
go: malformed import path ".": invalid path element "."
Error: command "sh -c cd /var/folders/bt/6rr5l1js5w3_49gm0pvqh7wr0000gn/T/variant-.509876642; go mod init . && go build -o /cli/mycli /var/folders/bt/6rr5l1js5w3_49gm0pvqh7wr0000gn/T/variant-.509876642": exit status 1
Possible Solutions
Expand the path of the first argument . to the relative or absolute path
Falling back to the second arg as the arg passed to go mod init
Problem
When exporting a binary, the path must be a directory name or an absolute path. Using the
.
throw an error.Error
Possible Solutions
.
to the relative or absolute pathgo mod init