command
module
Version:
v0.0.0-...-44a96fa
Opens a new window with list of versions in this module.
Published: Dec 10, 2018
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gocontract
gocontract
is a very simple utility which detects uninitialized and struct fields in a Go file. Detection is opt-in.
Usage
gocontract [file]
file Go source file.
Example
Input file: example.go
package example
type Abc struct {
val *int `json:"config" require:"assignment,NewAbc , NewAbcOther"`
}
func NewAbc() Abc {
val := 42
return Abc{
val: &val}
}
func NewAbcOther() *Abc {
return &Abc{}
}
Output:
./gocontract example.go
example.go uninitialized struct field Abc.val in NewAbcOther
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.