chore: pin GH commits and switch to golangci-lint (#4444)

* chore: pin GH commits

* switch to golangci-lint-action

* fix lint issues
This commit is contained in:
David Zhao
2026-04-11 13:04:22 -07:00
committed by GitHub
parent 2974ba879f
commit 4b3856125c
37 changed files with 127 additions and 108 deletions
@@ -246,8 +246,8 @@ func (w *DependencyDescriptorWriter) writeExtendedFields() error {
}
func (w *DependencyDescriptorWriter) writeTemplateDependencyStructure() error {
if !(w.structure.StructureId >= 0 && w.structure.StructureId < MaxTemplates &&
w.structure.NumDecodeTargets > 0 && w.structure.NumDecodeTargets <= MaxDecodeTargets) {
if w.structure.StructureId < 0 || w.structure.StructureId >= MaxTemplates ||
w.structure.NumDecodeTargets <= 0 || w.structure.NumDecodeTargets > MaxDecodeTargets {
return fmt.Errorf("invalid arguments, structureId: %d, numDecodeTargets: %d", w.structure.StructureId, w.structure.NumDecodeTargets)
}
@@ -283,8 +283,8 @@ func (w *DependencyDescriptorWriter) writeTemplateDependencyStructure() error {
}
func (w *DependencyDescriptorWriter) writeTemplateLayers() error {
if !(len(w.structure.Templates) > 0 && len(w.structure.Templates) <= MaxTemplates &&
w.structure.Templates[0].SpatialId == 0 && w.structure.Templates[0].TemporalId == 0) {
if len(w.structure.Templates) <= 0 || len(w.structure.Templates) > MaxTemplates ||
w.structure.Templates[0].SpatialId != 0 || w.structure.Templates[0].TemporalId != 0 {
return fmt.Errorf("invalid templates, len %d, templates[0]: spatialId %d, temporalId %d", len(w.structure.Templates), w.structure.Templates[0].SpatialId, w.structure.Templates[0].TemporalId)
}
for i := 1; i < len(w.structure.Templates); i++ {