pkger/here/module.go

26 lines
447 B
Go
Raw Permalink Normal View History

2019-08-05 00:13:27 +03:00
package here
2019-10-09 20:21:54 +03:00
import (
"encoding/json"
)
2019-08-05 00:13:27 +03:00
type Module struct {
2019-11-01 22:53:54 +03:00
Path string `json:"path"`
Main bool `json:"main"`
Dir string `json:"dir"`
GoMod string `json:"go_mod"`
GoVersion string `json:"go_version"`
2019-08-05 00:13:27 +03:00
}
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()
}