pkger/here/module.go

26 lines
368 B
Go
Raw 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-09 22:26:33 +03:00
Path string
Main bool
Dir string
GoMod string
GoVersion string
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()
}