Skip to content

Conversation

fireflycons
Copy link
Contributor

These methods cause a panic due the the fact that ShowCursor and HideCursor are not methods in kernel32.dll

Additionally the initSyscall function was never being invoked.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x7ee824]

goroutine 1 [running]:
syscall.(*LazyProc).Find(0x1000000009826c0?)
        C:/Program Files/Go/src/syscall/dll_windows.go:245 +0x24
syscall.(*LazyProc).mustFind(...)
        C:/Program Files/Go/src/syscall/dll_windows.go:267
syscall.(*LazyProc).Call(0x0, {0x0, 0x0, 0x0})
        C:/Program Files/Go/src/syscall/dll_windows.go:285 +0x28
github.com/hedzr/progressbar/cursor.hideCursor()
        C:/dev/progressbar-orig/cursor/cursor_windows.go:109 +0x25
github.com/hedzr/progressbar/cursor.Hide(...)
        C:/dev/progressbar-orig/cursor/cursor.go:7
main.main()
        C:/dev/progressbar-orig/examples/schema/schema.go:66 +0x25

@fireflycons fireflycons requested a review from hedzr as a code owner October 3, 2024 05:26
Copy link
Owner

@hedzr hedzr left a comment

Choose a reason for hiding this comment

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

nice and thanks

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11156400369

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 6.835%

Totals Coverage Status
Change from base Build 8753668156: 0.0%
Covered Lines: 46
Relevant Lines: 673

💛 - Coveralls

@hedzr hedzr merged commit 6151eb2 into hedzr:master Oct 3, 2024
5 checks passed
hedzr added a commit that referenced this pull request Oct 3, 2024
  - security patches
  - fixed [#4](#4): cursor hide/show on windows platform, thanks [@fireflycons](https://github.com/fireflycons)
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.

3 participants