Skip to content

Commit f3a3f17

Browse files
committed
chore: apply go fix
1 parent d006043 commit f3a3f17

3 files changed

Lines changed: 64 additions & 64 deletions

File tree

pkg/packet/pcep/tlv.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ func (tlv *PathSetupTypeCapability) DecodeFromBytes(data []byte) error {
10471047
pstNum := int(value[PathSetupTypeCapabilityPSTCountOffset])
10481048

10491049
tlv.PathSetupTypes = make([]Pst, 0, pstNum)
1050-
for i := 0; i < pstNum; i++ {
1050+
for i := range pstNum {
10511051
offset := PathSetupTypeCapabilityFixedPartLength + i
10521052
if offset >= len(value) {
10531053
return fmt.Errorf("PathSetupTypeCapability: value too short for PathSetupTypes entries")
@@ -1090,7 +1090,7 @@ func (tlv *PathSetupTypeCapability) Serialize() []byte {
10901090
value := make([]byte, fixedPartLen)
10911091
value[PathSetupTypeCapabilityPSTCountOffset] = byte(pstCount)
10921092

1093-
for i := 0; i < pstCount; i++ {
1093+
for i := range pstCount {
10941094
value[PathSetupTypeCapabilityFixedPartLength+i] =
10951095
byte(tlv.PathSetupTypes[i])
10961096
}
@@ -1215,7 +1215,7 @@ func (tlv *AssocTypeList) DecodeFromBytes(data []byte) error {
12151215

12161216
assocNum := len(value) / 2
12171217
tlv.AssocTypes = make([]AssocType, assocNum)
1218-
for i := 0; i < assocNum; i++ {
1218+
for i := range assocNum {
12191219
tlv.AssocTypes[i] = AssocType(binary.BigEndian.Uint16(value[2*i : 2*i+2]))
12201220
}
12211221

pkg/packet/pcep/tlv_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func isIPv4Bytes(b []byte) bool {
6464
if len(b) != IPv6AddrLen {
6565
return false
6666
}
67-
for i := 0; i < IPv4InIPv6Offset; i++ {
67+
for i := range IPv4InIPv6Offset {
6868
if b[i] != 0 {
6969
return false
7070
}

0 commit comments

Comments
 (0)