Skip to content

Commit

Permalink
fix golint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Jul 28, 2020
1 parent 74ff40a commit eeaab00
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
10 changes: 5 additions & 5 deletions layer-mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ type layerMdns struct {
TransactionId uint16
IsResponse bool
Opcode uint8
Questions []MdnsQuestion
Answers []MdnsAnswer
Questions []mdnsQuestion
Answers []mdnsAnswer
AuthorityCount uint16
AdditionalCount uint16
}

type MdnsQuestion struct {
type mdnsQuestion struct {
Query string
Type uint16
Class uint16
}

type MdnsAnswer struct {
type mdnsAnswer struct {
Query string
Type uint16
Class uint16
Expand Down Expand Up @@ -96,7 +96,7 @@ func (l *layerMdns) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) err

l.Answers = nil
for i := uint16(0); i < answerCount; i++ {
a := MdnsAnswer{}
a := mdnsAnswer{}

var read int
a.Query, read = dnsQueryDecode(data, pos)
Expand Down
16 changes: 8 additions & 8 deletions layer-nbns.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ type layerNbns struct {
Truncated bool
Recursion bool
Broadcast bool
Questions []NbnsQuestion
Answers []NbnsAnswer
Questions []nbnsQuestion
Answers []nbnsAnswer
AuthorityCount uint16
AdditionalCount uint16
}

type NbnsQuestion struct {
type nbnsQuestion struct {
Query string
Type uint16
Class uint16
}

type NbnsAnswer struct {
type nbnsAnswer struct {
Query string
Type uint16
Class uint16
TTL uint32
Names []NbnsAnswerName
Names []nbnsAnswerName
}

type NbnsAnswerName struct {
type nbnsAnswerName struct {
Name string
Type uint8
Flags uint16
Expand Down Expand Up @@ -110,7 +110,7 @@ func (l *layerNbns) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) err

l.Answers = nil
for i := uint16(0); i < answerCount; i++ {
a := NbnsAnswer{}
a := nbnsAnswer{}

var read int
a.Query, read = dnsQueryDecode(data, pos)
Expand All @@ -131,7 +131,7 @@ func (l *layerNbns) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) err
pos2++

for j := uint8(0); j < nameCount; j++ {
a.Names = append(a.Names, NbnsAnswerName{
a.Names = append(a.Names, nbnsAnswerName{
Name: strings.TrimSuffix(string(data[pos2:pos2+15]), " "),
Type: data[pos2+15],
Flags: binary.BigEndian.Uint16(data[pos2+16 : pos2+18]),
Expand Down
2 changes: 1 addition & 1 deletion method-mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (mm *methodMdns) request(destIp net.IP) {
udp.SetNetworkLayerForChecksum(&ip)
mdns := layerMdns{
TransactionId: 0,
Questions: []MdnsQuestion{
Questions: []mdnsQuestion{
{
Query: fmt.Sprintf("%d.%d.%d.%d.in-addr.arpa", destIp[3], destIp[2], destIp[1], destIp[0]),
Type: 0x0C, // domain pointer
Expand Down
2 changes: 1 addition & 1 deletion method-nbns.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (mn *methodNbns) request(destIp net.IP) {

nbns := layerNbns{
TransactionId: randUint16(),
Questions: []NbnsQuestion{
Questions: []nbnsQuestion{
{
Query: "CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
Type: 0x21, // NB_STAT
Expand Down
2 changes: 0 additions & 2 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,6 @@ func (u *ui) drawScrollableTable(startX int, startY int, width int, height int,
// reduce space
endX -= 1
endY -= 1
width -= 1
height -= 1

// draw columns
x := startX + *scrollX
Expand Down

0 comments on commit eeaab00

Please sign in to comment.