Open ahsan-n opened 1 year ago
package main
import ( "fmt" "log" "net/url" "time"
"github.com/hashicorp/go-getter"
)
func main() { detector := getter.GitHubDetector{}
detect, b, err := detector.Detect("github.com/user/modules.git//onboarding?ref=32.1.0", "")
if err != nil {
log.Printf("unable to download %v", detect)
}
fmt.Println(detect, b)
parse, err := url.Parse(detect)
if err != nil {
log.Printf("asd %v", err)
}
fmt.Println(parse.Host)
gitGetter := getter.GitGetter{Timeout: time.Duration(0)}
// Update the Git URL to the correct one without any reference to remote-git
gitURL := "https://" + parse.Host + parse.Path
err = gitGetter.Get("./service-onboarding", gitURL)
if err != nil {
log.Printf("issue %v", err)
}
}
Hi, trying to download dir from git with following code:
but getting the error:
Wondering what I am missing, running in Mac os