Code to reproduce:
package main
import (
"github.com/joho/godotenv"
"github.com/gemini-oss/rego/pkg/snipeit"
)
func main() {
err := godotenv.Load()
if err != nil {
panic(err)
}
_, clientErr := snipeit.NewClient(1).Assets().GetAllAssets()
if clientErr != nil {
panic(clientErr)
}
}
.env file
Using base url and token from snipe api reference examples.
Error gotten:
If asset has last_audit_date set I get this:
{snipeit} {assets.go:111} FATAL - Error fetching hardware list: unmarshalling error: json: cannot unmarshal object into Go struct field Hardware.rows.last_audit_date of type string
It also happens on next_audit_date
Code to reproduce:
.env file
Using base url and token from snipe api reference examples.
Error gotten:
If asset has last_audit_date set I get this:
It also happens on next_audit_date