Skip to content

Conversation

@hut8
Copy link

@hut8 hut8 commented Apr 17, 2025

This is a group of a couple of fixes:

  1. go-staticcheck says that error messages shouldn't begin with capital letters. So I downcased them.
  2. return errors.New("abort signal receive") was present in the middle of a function during the crawling of /sys/devices. That makes it so that we can't distinguish between that particular error and any other error (at least, not easily). That error is special because it's one that's actually triggered by the user just to stop the crawling process, so the user is very likely to treat it as not an error. This makes that possible.
  3. ioutil has been deprecated for a long time now, so I replaced that with io.* or os.*.
  4. It was very helpful of you to include links to kernel source where applicable. Unfortunately those links died, so I replaced them with working ones.

@hut8 hut8 marked this pull request as draft April 18, 2025 00:08
@pilebones
Copy link
Owner

Hello, ty for this initiative, I really appreciate.

I planned to do a lot of changes soon like you did, because several enhancement about go, tools and linters exists since I start to impl this library. And many idea to enhance this lib to do in my head.

I'm ok to merge your contributions asap to restart the machine on this project. Please let me know when it will be not a draft.

Have a good day :)

@pilebones pilebones self-requested a review April 18, 2025 15:20
@pilebones pilebones added quality Code quality ci continuous improvement labels Apr 18, 2025
@pilebones
Copy link
Owner

I re-run golangci-lint to fix linters issues and push fixes to master, could you rebase your PR for merging the other purpose from your PR please ?

@pilebones pilebones force-pushed the master branch 3 times, most recently from 5c1ec37 to c3fe89d Compare April 21, 2025 17:33
@hut8
Copy link
Author

hut8 commented Apr 22, 2025

Yes, I will be happy to!

@hut8 hut8 force-pushed the liam/linter-and-link-fixes branch from 0b44c10 to 01072ba Compare April 23, 2025 18:18
@hut8 hut8 marked this pull request as ready for review April 23, 2025 18:20
@hut8
Copy link
Author

hut8 commented Apr 23, 2025

Rebased: let me know what you think 😄

// see:
// - http://elixir.free-electrons.com/linux/v3.12/source/include/uapi/linux/netlink.h#L23
// - http://elixir.free-electrons.com/linux/v3.12/source/include/uapi/linux/socket.h#L11
// - https://elixir.bootlin.com/linux/v6.14.1/source/include/uapi/linux/netlink.h#L23
Copy link
Owner

@pilebones pilebones May 4, 2025

Choose a reason for hiding this comment

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

Nice catch for these kind of changes, the site changed since I started this project 👍

But it is this link : https://elixir.bootlin.com/linux/v6.14.1/source/include/uapi/linux/netlink.h#L24

Btw, It could be nice to change also the links in the README.

// - http://elixir.free-electrons.com/linux/v3.12/source/include/uapi/linux/netlink.h#L23
// - http://elixir.free-electrons.com/linux/v3.12/source/include/uapi/linux/socket.h#L11
// - https://elixir.bootlin.com/linux/v6.14.1/source/include/uapi/linux/netlink.h#L23
// - https://elixir.bootlin.com/linux/v6.14.1/source/include/uapi/linux/socket.h#L11
Copy link
Owner

@pilebones pilebones May 4, 2025

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci continuous improvement quality Code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants