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

When sysinfo is a global variable, when si.GetSysInfo () is executed multiple times, the slice will increase repeatedly. #18

Closed
offer365 opened this issue Dec 21, 2019 · 1 comment

Comments

@offer365
Copy link

offer365 commented Dec 21, 2019

si.Network = make([]NetworkDevice, 0)
for _, link := range devices {...}
   I think this is better.

https://github.com/offer365/example/tree/master/winsysinfo
This is my package under win, is there any interest?

@zcalusic
Copy link
Owner

zcalusic commented Jan 9, 2020

Hello @offer365 and thanks for your report.

While there's not much sense in calling GetSysInfo() more than once per program invocation, you're right that this is still a bug.

So, I'll go and fix it right away...

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

2 participants