Skip to content

major refactor#4

Merged
mosajjal merged 4 commits intomasterfrom
formatting
Aug 19, 2022
Merged

major refactor#4
mosajjal merged 4 commits intomasterfrom
formatting

Conversation

@mosajjal
Copy link
Copy Markdown
Contributor

planning to merge this into master with references to original repo changed to gopacket/gopacket, and a 1.19 version of go fmt applied to the entire codebase. Will give this a couple of days so people can submit their PRs before so I don't have to deal with merge conflicts.

}

/// IEEE 802.1 TLV Subtypes
// / IEEE 802.1 TLV Subtypes
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spurious slash?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an automate output of go fmt. not really keen to change it since it'll get reverted back to this on save anyway. I'll take a look in the context of that particular line though.

}
checkLayers(p, []gopacket.LayerType{LayerTypeEthernet, LayerTypeIPv6, LayerTypeIPv6HopByHop, LayerTypeICMPv6, LayerTypeMLDv1MulticastListenerQuery}, t)
// See https://github.com/google/gopacket/issues/517
// See https://github.com/gopacket/gopacket/issues/517
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this reference works anymore. Continue to point to google/gopacket?

(same comment across all other files that reference this issue)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes this needs to be reverted back. can't believe my findall/replace in vscode had negative consequences 😮

layers/sflow.go Outdated
// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
// | TOS |
// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
// 0 15 31
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the things in this file should be indented to be monospace

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you mean? looks like it's gone from spaces to tabs which is a go recommended way?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think this was a different error than what I was thinking (and one not intruduced in this PR). I was thinking these were godoc comments, like this:

//<one space>SFlowIpv4Record foos the bar
//<two spaces>packet format

If it had been, then that would have made the packet format monospace in the godoc. However, the lack of the first line with a //<single space>godoc start invalidates that. As is, all of these will (continue to) render in poorly-formatted non-monospace and probably look really weird in the godoc. (confirmed: https://pkg.go.dev/github.com/google/gopacket@v1.1.19/layers#SFlowIpv4Record)

If you'd like to leave as is, tots fine. However, if you're in here and want things to look a little nicer, you could change

//<two spaces>packet format

to

//<one space><Struct Name>
//
//<tab>packet format

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaaah I got what you mean now. Happy to include it in the current PR

@mosajjal mosajjal merged commit 06eb3d7 into master Aug 19, 2022
@mosajjal mosajjal deleted the formatting branch August 19, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants