Skip to content

Commit fc17fde

Browse files
authored
Initial commit
0 parents  commit fc17fde

File tree

9 files changed

+127
-0
lines changed

9 files changed

+127
-0
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [bep]

.github/workflows/test.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
branches: [ main ]
4+
pull_request:
5+
name: Test
6+
jobs:
7+
test:
8+
strategy:
9+
matrix:
10+
go-version: [1.19.x,1.20.x]
11+
platform: [ubuntu-latest, macos-latest, windows-latest]
12+
runs-on: ${{ matrix.platform }}
13+
steps:
14+
- name: Install Go
15+
uses: actions/setup-go@v3
16+
with:
17+
go-version: ${{ matrix.go-version }}
18+
- name: Install staticcheck
19+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
20+
shell: bash
21+
- name: Install golint
22+
run: go install golang.org/x/lint/golint@latest
23+
shell: bash
24+
- name: Update PATH
25+
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
26+
shell: bash
27+
- name: Checkout code
28+
uses: actions/checkout@v1
29+
- name: Fmt
30+
if: matrix.platform != 'windows-latest' # :(
31+
run: "diff <(gofmt -d .) <(printf '')"
32+
shell: bash
33+
- name: Vet
34+
run: go vet ./...
35+
- name: Staticcheck
36+
run: staticcheck ./...
37+
- name: Lint
38+
run: golint ./...
39+
- name: Test
40+
run: go test -race ./...

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Bjørn Erik Pedersen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[![Tests on Linux, MacOS and Windows](https://github.com/bep/golibtemplate/workflows/Test/badge.svg)](https://github.com/bep/golibtemplate/actions?query=workflow:Test)
2+
[![Go Report Card](https://goreportcard.com/badge/github.com/bep/golibtemplate)](https://goreportcard.com/report/github.com/bep/golibtemplate)
3+
[![GoDoc](https://godoc.org/github.com/bep/golibtemplate?status.svg)](https://godoc.org/github.com/bep/golibtemplate)

go.mod

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module github.com/bep/golibtemplate
2+
3+
go 1.18
4+
5+
require (
6+
github.com/frankban/quicktest v1.14.2 // indirect
7+
github.com/google/go-cmp v0.5.7 // indirect
8+
github.com/kr/pretty v0.3.0 // indirect
9+
github.com/kr/text v0.2.0 // indirect
10+
github.com/rogpeppe/go-internal v1.6.1 // indirect
11+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
12+
)

go.sum

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2+
github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns=
3+
github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
4+
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
5+
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
6+
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
7+
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
8+
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
9+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
10+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
11+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
12+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
13+
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
14+
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
15+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
16+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
17+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
18+
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=

lib.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package golibtemplate
2+
3+
func Foo() string {
4+
return "foo"
5+
}

lib_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package golibtemplate
2+
3+
import (
4+
"testing"
5+
6+
qt "github.com/frankban/quicktest"
7+
)
8+
9+
func TestFoo(t *testing.T) {
10+
c := qt.New(t)
11+
c.Assert(Foo(), qt.Equals, "foo")
12+
}

0 commit comments

Comments
 (0)