Skip to content

Commit ffd1969

Browse files
committed
README
1 parent 727a787 commit ffd1969

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
# GRT
1+
# GRT (GO Repo Template)
22

33
[![CI][badge-build]][build]
44
[![GoDoc][go-docs-badge]][go-docs]
55
[![GoReportCard][go-report-card-badge]][go-report-card]
66
[![License][badge-license]][license]
77

8-
GO Repo Template
9-
108
## Motivation
119

10+
This repo aims to save some boostrapping time when creating a new GO repo.
11+
1212
## Contents
13+
- [.pre-commit-config.yaml](.pre-commit-config.yaml): a set of pre-commit hooks relevant to GO code
14+
- [.goreleaser.yaml](.goreleaser.yaml): [goreleaser](https://goreleaser.com/quick-start) configuration file
15+
- [.github/workflows/go.yml](.github/workflows/go.yml): GH action for post push and pull request testing
16+
- [.github/workflows/release.yml](.github/workflows/release.yml): GH action to trigger upon tag creation
17+
18+
## Bootstrapping steps
19+
- Fork this repo
20+
- Under `https://github.com/YOUR_ORG/grt/settings`, make sure `Template repository` is checked
21+
- When creating a new GO repo, select `grt` as the `Repository template`
22+
- Clone the new repo
23+
- Run `go run cmd/grt.go -i README.tmpl.md -o README.md -r github.com/YOUR_ORG/YOUR_REPO_NAME`
24+
- Edit README.md and fill in the different sections
25+
- Set the desired LICENSE (default is AGPLv3)
26+
27+
### pre-commit hooks
28+
29+
### grt.go
30+
31+
### grt_test.go
32+
33+
### cmd/grt.go
1334

14-
## Usage
35+
### Goreleaser
1536

1637
[license]: ./LICENSE
1738
[badge-license]: https://img.shields.io/github/license/jessp01/grt.svg

grt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func ReplaceTokens(inputFilePath, outputFilePath, repoHost, repoOrg, repoName, n
1616
newRepoHost := parts[0]
1717
newRepoOrg := parts[1]
1818
newRepoName := parts[2]
19-
log.Printf("repoHost: %s, repoOrg: %s, repoName: %s, newRepoHost: %s, newRepoOrg: %s, newRepoName: %s\n", repoHost, repoOrg, repoName, newRepoHost, newRepoOrg, newRepoName)
19+
// log.Printf("repoHost: %s, repoOrg: %s, repoName: %s, newRepoHost: %s, newRepoOrg: %s, newRepoName: %s\n", repoHost, repoOrg, repoName, newRepoHost, newRepoOrg, newRepoName)
2020
inplace := false
2121

2222
if outputFilePath == "" {
@@ -35,10 +35,10 @@ func ReplaceTokens(inputFilePath, outputFilePath, repoHost, repoOrg, repoName, n
3535

3636
if inplace {
3737
script.File(outputFilePath).Stdout()
38-
log.Printf("Moving %s to %s\n", outputFilePath, inputFilePath)
3938
e := os.Rename(outputFilePath, inputFilePath)
4039
if e != nil {
4140
log.Fatal(e)
4241
}
4342
}
43+
log.Printf("Replaced tokens in %s and created %s\n", inputFilePath, outputFilePath)
4444
}

0 commit comments

Comments
 (0)