feat: add code generation for Unifi client interface (#11)
* feat: add code generation for Unifi client interface * chore: apply linter hints * chore: add tests * fix: nondeterministic client function signature due to iteration of map params * chore: add move version tests * chore: add more generator tests * chore: lint
This commit is contained in:
committed by
GitHub
parent
c6e20b675c
commit
6016a3d34a
@@ -61,7 +61,7 @@ func latestUnifiVersion() (*UnifiVersion, error) {
|
||||
}
|
||||
|
||||
for _, firmware := range respData.Embedded.Firmware {
|
||||
if firmware.Platform != debianPlatform {
|
||||
if firmware.Platform != debianPlatform || firmware.Version == nil {
|
||||
continue
|
||||
}
|
||||
return NewUnifiVersion(firmware.Version.Core(), firmware.Links.Data.Href), nil
|
||||
@@ -102,7 +102,8 @@ const UnifiVersion = %q
|
||||
return err
|
||||
}
|
||||
|
||||
return os.WriteFile(filepath.Join(outDir, "version.generated.go"), versionGo, 0o644)
|
||||
_, err = writeGeneratedFile(outDir, "version", string(versionGo))
|
||||
return err
|
||||
}
|
||||
|
||||
func writeVersionRepoMarkerFile(version *version.Version, outDir string) error {
|
||||
|
||||
Reference in New Issue
Block a user