-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample_118_test.go
More file actions
23 lines (18 loc) · 564 Bytes
/
Copy pathexample_118_test.go
File metadata and controls
23 lines (18 loc) · 564 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright © 2022 Vasiliy Vasilyuk. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.18
// +build go1.18
package pointer_test
import (
"github.com/xorcare/pointer"
)
func ExampleOf() {
// Examples for values that have default type casting.
var _ *int = pointer.Of(0)
var _ *bool = pointer.Of(true)
var _ *string = pointer.Of("example")
// Example of usage with non default type casting.
var _ *int8 = pointer.Of(int8(0))
var _ *int8 = pointer.Of[int8](0)
}