mirror of
https://github.com/cheat/cheat.git
synced 2024-11-24 15:01:36 +01:00
bfb071c0b2
- Add `package` comments - Rename `opts` to `_` where unused
27 lines
514 B
Go
27 lines
514 B
Go
// Package repo implements functions pertaining to the management of git repos.
|
|
package repo
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/go-git/go-git/v5"
|
|
)
|
|
|
|
// Clone clones the repo available at `url`
|
|
func Clone(url string) error {
|
|
|
|
// clone the community cheatsheets
|
|
_, err := git.PlainClone(url, false, &git.CloneOptions{
|
|
URL: "https://github.com/cheat/cheatsheets.git",
|
|
Depth: 1,
|
|
Progress: os.Stdout,
|
|
})
|
|
|
|
if err != nil {
|
|
return fmt.Errorf("failed to clone cheatsheets: %v", err)
|
|
}
|
|
|
|
return nil
|
|
}
|