We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bd3647 commit 0c54386Copy full SHA for 0c54386
examples/examples.go
@@ -1,4 +1,19 @@
1
-// Package examples provides a collection of example functions
2
-package examples
+// Package main provides examples for the safe conversion package.
+package main
3
4
-// TODO - Add example functions that demonstrate the usage of the safe conversion package
+import (
5
+ "log"
6
+
7
+ safeconversion "github.com/bsv-blockchain/go-safe-conversion"
8
+)
9
10
+// main function demonstrates the usage of safe conversion functions.
11
+func main() {
12
13
+ // Example of converting int32 to uint32 safely
14
+ val, err := safeconversion.Int32ToUint32(42)
15
+ if err != nil {
16
+ log.Fatal(err)
17
+ }
18
+ log.Printf("Converted value: %d", val)
19
+}
0 commit comments