@@ -196,7 +196,6 @@ func Load(path string, opts Options) (*Tree, error) {
196196 }
197197
198198 if opts .IPVersion == 0 {
199- //nolint:gosec // no risk. Will be 4 or 6.
200199 opts .IPVersion = int (metadata .IPVersion )
201200 }
202201
@@ -205,7 +204,6 @@ func Load(path string, opts Options) (*Tree, error) {
205204 }
206205
207206 if opts .RecordSize == 0 {
208- //nolint:gosec // no risk. Will be 24, 28, or 32.
209207 opts .RecordSize = int (metadata .RecordSize )
210208 }
211209
@@ -653,17 +651,13 @@ func (t *Tree) writeMetadata(dw *dataWriter) (int64, error) {
653651
654652 // Although it might make sense to change the type on this, there is no use
655653 // case where someone would reasonably pass a negative build epoch.
656- //nolint:gosec // See above.
657654 "build_epoch" : mmdbtype .Uint64 (t .buildEpoch ),
658655 "database_type" : mmdbtype .String (t .databaseType ),
659656 "description" : description ,
660- //nolint:gosec // no risk. Will be 4 or 6.
661- "ip_version" : mmdbtype .Uint16 (t .ipVersion ),
662- "languages" : languages ,
663- //nolint:gosec // checked above
664- "node_count" : mmdbtype .Uint32 (t .nodeCount ),
665- //nolint:gosec // no risk. Will be 24, 28, or 32.
666- "record_size" : mmdbtype .Uint16 (t .recordSize ),
657+ "ip_version" : mmdbtype .Uint16 (t .ipVersion ),
658+ "languages" : languages ,
659+ "node_count" : mmdbtype .Uint32 (t .nodeCount ),
660+ "record_size" : mmdbtype .Uint16 (t .recordSize ),
667661 }
668662 return metadata .WriteTo (dw )
669663}
0 commit comments