Skip to content

Commit be52e9d

Browse files
authored
Github actions and other updates (#9)
1 parent 14dc03c commit be52e9d

File tree

9 files changed

+74
-18
lines changed

9 files changed

+74
-18
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: github-actions
8+
directory: "/"
9+
schedule:
10+
interval: daily

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 'stable'
20+
21+
- name: Go Format
22+
run: gofmt -s -w . && git diff --exit-code
23+
24+
- name: Go Tidy
25+
run: go mod tidy && git diff --exit-code
26+
27+
- name: Go Mod
28+
run: go mod download
29+
30+
- name: Build
31+
run: go build ./...
32+
33+
- name: Test
34+
run: go test -v -race -shuffle=on ./...

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
[![Go Report Card](https://goreportcard.com/badge/github.com/go-toolsmith/typep)](https://goreportcard.com/report/github.com/go-toolsmith/typep)
2-
[![GoDoc](https://godoc.org/github.com/go-toolsmith/typep?status.svg)](https://godoc.org/github.com/go-toolsmith/typep)
3-
[![Build Status](https://travis-ci.org/go-toolsmith/typep.svg?branch=master)](https://travis-ci.org/go-toolsmith/typep)
4-
51
# typep
62

7-
Package typep provides type predicates.
3+
[![build-img]][build-url]
4+
[![pkg-img]][pkg-url]
5+
[![reportcard-img]][reportcard-url]
6+
[![version-img]][version-url]
7+
8+
Package `typep` provides type predicates.
89

910
## Installation:
1011

12+
Go version 1.16+
13+
1114
```bash
12-
go get -v github.com/go-toolsmith/typep
15+
go get github.com/go-toolsmith/typep
1316
```
1417

1518
## Example
@@ -29,9 +32,23 @@ func main() {
2932
intTyp := types.Typ[types.Int]
3033
ptr := types.NewPointer(intTyp)
3134
arr := types.NewArray(intTyp, 64)
35+
3236
fmt.Println(typep.HasFloatProp(floatTyp)) // => true
3337
fmt.Println(typep.HasFloatProp(intTyp)) // => false
3438
fmt.Println(typep.IsPointer(ptr)) // => true
3539
fmt.Println(typep.IsArray(arr)) // => true
3640
}
3741
```
42+
43+
## License
44+
45+
[MIT License](LICENSE).
46+
47+
[build-img]: https://github.com/go-toolsmith/typep/workflows/build/badge.svg
48+
[build-url]: https://github.com/go-toolsmith/typep/actions
49+
[pkg-img]: https://pkg.go.dev/badge/go-toolsmith/typep
50+
[pkg-url]: https://pkg.go.dev/github.com/go-toolsmith/typep
51+
[reportcard-img]: https://goreportcard.com/badge/go-toolsmith/typep
52+
[reportcard-url]: https://goreportcard.com/report/go-toolsmith/typep
53+
[version-img]: https://img.shields.io/github/v/release/go-toolsmith/typep
54+
[version-url]: https://github.com/go-toolsmith/typep/releases

example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func Example() {
1212
intTyp := types.Typ[types.Int]
1313
ptr := types.NewPointer(intTyp)
1414
arr := types.NewArray(intTyp, 64)
15+
1516
fmt.Println(typep.HasFloatProp(floatTyp)) // => true
1617
fmt.Println(typep.HasFloatProp(intTyp)) // => false
1718
fmt.Println(typep.IsPointer(ptr)) // => true

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module github.com/go-toolsmith/typep
2+
3+
go 1.16
File renamed without changes.

simplePredicates.go renamed to simple_predicates.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

simplePredicates_generate.go renamed to simple_predicates_generate.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build ignore
12
// +build ignore
23

34
package main
@@ -75,7 +76,7 @@ func main() {
7576
},
7677
}
7778

78-
simplePredicateFile, err := os.Create("simplePredicates.go")
79+
simplePredicateFile, err := os.Create("simple_predicates.go")
7980
if err != nil {
8081
log.Fatal(err)
8182
}
@@ -94,7 +95,7 @@ func generateCode(tmplText string, typeList types) []byte {
9495
}
9596

9697
func writeCode(output io.Writer, typeList types) {
97-
code := generateCode(`// Code generated by simplePredicates_generate.go; DO NOT EDIT
98+
code := generateCode(`// Code generated by simple_predicates_generate.go; DO NOT EDIT
9899
99100
package typep
100101

0 commit comments

Comments
 (0)