Paul Lecuq
36c5d6f2ed
- web service with json support - web page - cron service to update database infos
30 lines
443 B
Go
30 lines
443 B
Go
package here
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type Module struct {
|
|
Path string
|
|
Main bool
|
|
Dir string
|
|
GoMod string
|
|
GoVersion string
|
|
}
|
|
|
|
func (i Module) String() string {
|
|
b, err := json.MarshalIndent(i, "", " ")
|
|
if err != nil {
|
|
return err.Error()
|
|
}
|
|
return string(b)
|
|
}
|
|
|
|
func (i Module) IsZero() bool {
|
|
const cla = "command-line-arguments"
|
|
if i.Path == cla {
|
|
i.Path = ""
|
|
}
|
|
return i.String() == Module{}.String()
|
|
}
|