Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

major refactor #4

Merged
merged 4 commits into from
Aug 19, 2022
Merged

major refactor #4

merged 4 commits into from
Aug 19, 2022

Conversation

mosajjal
Copy link
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.

@@ -240,7 +240,7 @@ type LinkLayerDiscoveryInfo struct {
Unknown []LinkLayerDiscoveryValue // undecoded TLVs
}

/// IEEE 802.1 TLV Subtypes
// / IEEE 802.1 TLV Subtypes

Choose a reason for hiding this comment

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

spurious slash?

Copy link
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.

@@ -51,7 +54,7 @@ func TestPacketMulticastListenerQueryMessageV1(t *testing.T) {
t.Error("Failed to decode packet:", p.ErrorLayer().Error())
}
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

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
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

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
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?

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
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