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

Plan to v2 and introduce Breaking Change #174

Closed
3 tasks done
shirou opened this issue Mar 8, 2016 · 8 comments
Closed
3 tasks done

Plan to v2 and introduce Breaking Change #174

shirou opened this issue Mar 8, 2016 · 8 comments

Comments

@shirou
Copy link
Owner

shirou commented Mar 8, 2016

After replacing lsof (#164) , I have a plan to use semantic versioning and use gopkg.in. Current will be tagged the v1 at that time, and start v2 branch.

I will appreciate if you write some comments about this idea.

list of (possible) breaking changes

  • change JSON key from snake_case to camlCase.
  • [ ] change types from int32/64 and so on, to just int and uint.
  • golint acceptable
    • net.NetConnections -> net.Connections, disk.DiskPartitions -> disk.Partitions and so on
  • process.State() returns 'R' not 'running' in Linux (see Breaking change: use state code rather than "description" #173)

... (add whenever we found something)

When v2 is introduced?

Target is end of March, 2016. But it may postponed.

@shirou
Copy link
Owner Author

shirou commented Mar 23, 2016

I have started migration to v2 on v2 branch.

@shirou
Copy link
Owner Author

shirou commented Mar 30, 2016

change types from int32/64 to int is deleted. I tried but I think it forces too many changes.

@shirou
Copy link
Owner Author

shirou commented Apr 7, 2016

I decided to not use gopkg.in. When I use github.com/shirou in source code, using gopkg.in becomes trouble due to the internal package. Change to recommend vendoring.

@miniwark
Copy link

Hi !

  • What about a Godeps file too ? This is used by gpm and may be useful as this library is a bit "low level" and therefore may be used by system monitoring tools (who generally need API stability and dependencies version management)
  • change types from int32/64 to int is deleted This would have been a good change... It would have been more easy to manage strings conversion for display by simply using always using strconv.Itoa() instead of strconv.FormatInt(i, 10) or strconv.FormatInt(int64(i), 10).

@shirou
Copy link
Owner Author

shirou commented Apr 12, 2016

Thank you for this comments.

Godeps or something

gopsutil itself depends only a few packages, for the Windows environment. I believe applications may use a vendoring, not library. And also, I always thinking about API stability. So if API is changed, I will introduce new major version like the v2. (BTW, Godeps is introduced by godep, I think)

change types from int32/64 to int is deleted This would have been a good change...

Yah, I was very worried about this. But when I tried, I had to change so many codes, so I gave up. sigh.

@miniwark
Copy link

so I gave up. sigh.

Don't give up! Code re-factoring is always a painful, but you will feel happy when done!

@codeskyblue
Copy link
Contributor

So, when modify cpu.TimeStat type from float64 to uint64. Because float64 always loss precision

@Lomanic
Copy link
Collaborator

Lomanic commented Aug 29, 2020

We are on v2 for a while now.

@Lomanic Lomanic closed this as completed Aug 29, 2020
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

No branches or pull requests

4 participants