hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.66k stars 239 forks source link

How to download a git repository using go-getter? #492

Open officialasishkumar opened 5 months ago

officialasishkumar commented 5 months ago

I have currently written a code in golang to download git repository using go-getter but not sure why it's not working. Can someone please help me out?

package main

import (
    "github.com/hashicorp/go-getter"
)

func main() {
    client := &getter.Client{
        Src: "git::https://github.com/kcl-lang/flask-demo-kcl-manifests?refs=ade147b",
        Dst: "/tmp",
        Pwd: "/tmp",
    }
    if err := client.Get(); err != nil {
        panic(err)
    }
}