mirror of https://github.com/markbates/pkger.git
24 lines
440 B
Go
24 lines
440 B
Go
|
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()
|
||
|
}
|