pkger/here/module.go

24 lines
440 B
Go
Raw Normal View History

2019-08-05 00:13:27 +03:00
package here
import "encoding/json"
type Module struct {
Path string `json:"Path"`
Main bool `json:"Main"`
Dir string `json:"Dir"`
GoMod string `json:"GoMod"`
GoVersion string `json:"GoVersion"`
}
func (i Module) String() string {
b, err := json.MarshalIndent(i, "", " ")
if err != nil {
return err.Error()
}
return string(b)
}
func (i Module) IsZero() bool {
return i.String() == Module{}.String()
}