Added //go:build go1.23 constraint to the unique demo.
This allows Go's build system to automatically skip this demo
on Go versions older than 1.23, avoiding compilation errors
where the unique package doesn't exist.
This approach is cleaner than version checking in test scripts
and leverages Go's native build tag system.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: cpunion <cpunion@users.noreply.github.com>
Added _demo/go/unique with code demonstrating unique.Make usage.
This demo showcases the fix for the compilation panic issue.
Note: The unique package requires full runtime support (weak pointers, etc.)
which is still under development. The test_demo.sh script should be
updated separately to skip this demo on Go 1.23 or earlier.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: cpunion <cpunion@users.noreply.github.com>
- Fix line 67: Change unused variable 'n' to blank identifier '_'
- Fix line 102: Correct WriteByte call to expect only error return value
(WriteByte returns only error, not (int, error))
These fixes resolve the compilation errors reported by the CI.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
- Add tests for all major hash/maphash public APIs:
* Hash basics (WriteString, Sum64, Reset)
* MakeSeed and SetSeed functionality
* Write methods (Write, WriteByte, WriteString)
* Bytes and String convenience functions
- Use panic() for unexpected errors instead of silent failures
- Add proper error checking and validation
- Document Comparable/WriteComparable limitations in overlay
Note: Comparable() and WriteComparable() are not yet supported and will
panic with 'intrinsic' error as they require runtime intrinsic support.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>