Documentation
¶
Overview ¶
Package gogen implements automation for Go code generation using go generate and templates.
usage example:
$ gogen maketests.go
$ go run maketests.go -output benchmarks.go
Index ¶
- Variables
- func ErrTest(name string, test interface{}, wantErr bool, t *testing.T) (typ string, ok bool)
- func GotWant(name, subname string, got, want interface{}, wantErr bool, t *testing.T) (err error)
- func NewRepo(reponame, license string, year int, user *UserConfig) (r *repoConfig, err error)
- func TestParallel(t *testing.T)
- func YearRange(y int) string
- type Any
- type Empty
- type UserConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultUserConfig = &UserConfig{
Name: "Michael Treanor",
Email: "skeptycal@gmail.com",
Username: "skeptycal",
DefaultLicense: "MIT",
DefaultCopyrightYear: 1975,
}
Functions ¶
func NewRepo ¶
func NewRepo(reponame, license string, year int, user *UserConfig) (r *repoConfig, err error)
func TestParallel ¶
func YearRange ¶
YearRange returns a string representation of the year range that is formatted as a typical copyright notice range.
examples:
2015-2020 1970-2019 2021
It will contain the given year, a dash, and the current year. If the y parameter is greater than the current year or more than 50 years ago, it is assumed to be an error and the current year is used. An info level log message is generated if the logger is set to show INFO level, but no error is returned.
Types ¶
type UserConfig ¶
type UserConfig struct { Name string `json:"name"` Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` DefaultLicense string `json:"default_license,omitempty"` DefaultCopyrightYear int `json:"default_copyright_year,omitempty"` }
func NewUser ¶
func NewUser(name, email, username, defaultLicense string, defaultCopyrightYear int) (*UserConfig, error)
func (*UserConfig) String ¶
func (c *UserConfig) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.