Skip to content

Commit

Permalink
add to module
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Feb 18, 2020
1 parent 45732a6 commit fd43acc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/to/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/Azure/azure-sdk-for-go/sdk/to

go 1.13
36 changes: 36 additions & 0 deletions sdk/to/to.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// +build go1.13

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package to

// BoolPtr returns a pointer to the provided bool.
func BoolPtr(b bool) *bool {
return &b
}

// Float32Ptr returns a pointer to the provided float32.
func Float32Ptr(i float32) *float32 {
return &i
}

// Float64Ptr returns a pointer to the provided float64.
func Float64Ptr(i float64) *float64 {
return &i
}

// Int32Ptr returns a pointer to the provided int32.
func Int32Ptr(i int32) *int32 {
return &i
}

// Int64Ptr returns a pointer to the provided int64.
func Int64Ptr(i int64) *int64 {
return &i
}

// StringPtr returns a pointer to the provided string.
func StringPtr(s string) *string {
return &s
}

0 comments on commit fd43acc

Please sign in to comment.