Marc Cataford
5a18a5bf44
All checks were successful
Pull-Request / tests (pull_request) Successful in 1m6s
Pull-Request / static-analysis (pull_request) Successful in 1m31s
Pull-Request / post-run (pull_request) Successful in 24s
Push / pre-run (push) Successful in 28s
Push / tests (push) Successful in 1m3s
Push / static-analysis (push) Successful in 1m29s
Push / post-run (push) Successful in 38s
docs: add documentation to core functions and structs
26 lines
466 B
Go
26 lines
466 B
Go
// Git wrapper
|
|
//
|
|
// Facilitates the usage of `git` commands when dealing with
|
|
// data living in repositories.
|
|
|
|
package git
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
type GitClient interface {
|
|
Clone(path string, destination string) (string, error)
|
|
}
|
|
|
|
type Git struct{}
|
|
|
|
func (g Git) Clone(path string, destination string) (string, error) {
|
|
cloneCmd := exec.Command("git", "clone", path, destination)
|
|
|
|
if err := cloneCmd.Run(); err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return path, nil
|
|
}
|