hashicorp / go-getter

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

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

Open officialasishkumar opened 1 month ago

officialasishkumar commented 1 month 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)
    }
}