I have imported an app from github which has many imports, spread in several files like:
import (
"log"
"net/http"
"github.com/johndoe/sleekrest/model"
"github.com/johndoe/sleekrest/shared/passhash"
"github.com/johndoe/sleekrest/shared/recaptcha"
"github.com/johndoe/sleekrest/shared/session"
"github.com/johndoe/sleekrest/shared/view"
"github.com/johndoe/csrfbanana"
)
I want to work on the packages on my local path /go/src/myrest
, so I'd like to have imports to be like
import (
"log"
"net/http"
"./model"
"./shared/passhash"
"./shared/recaptcha"
"./shared/session"
"./shared/view"
"./csrfbanana"
)
I know I can use bash commands like sed
, find
, etc to replace the import paths, but I'm wondering if there is an idiomatic way to do so in golang?