Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Pointer

A tool, that helps to create pointers on the fly.

For APIs, tests, etc

Usage:

import"github.com/spirin/pointer"typeBar{}
funcmain() {
pObj:=pointer.Of(Bar{})
pString:=pointer.Of("some string")
pIntA:=pointer.Of(1)
pIntB:=pointer.Of(2)
ifpointer.Equal(pIntA, pIntB){
...
}
ifpointer.EqualValue(pIntA, 123){
...
}
fmt.Println(pointer.Value(pIntB, 123))
// types that cannot be autoresolvedpInt64:=pointer.Int64(1)
pFloat16:=pointer.Float16(1)
...
}

About

A tool, that helps to create pointers on the fly

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages