3 examples of 'golang pointers' in Go

Every line of 'golang pointers' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
1436func (x *EmbeddedSt4) GetPointersStructField() *PointersStruct {
1437 if x != nil {
1438 return x.PointersStructField
1439 }
1440 return nil
1441}
14func resolvePointers(obj interface{}) interface{} {
15 if obj == nil {
16 return obj
17 }
18 obj_val := reflect.ValueOf(obj)
19 for obj_val.Kind() == reflect.Ptr {
20 obj_val = obj_val.Elem()
21 }
22 if obj_val.CanInterface() {
23 return obj_val.Interface()
24 } else {
25 return nil
26 }
27}
438func (ctx *Context) wrapDuktapePointer(
439 ptr unsafe.Pointer,
440 t reflect.Type,
441) func(in []reflect.Value) []reflect.Value {
442 return func(in []reflect.Value) []reflect.Value {
443 ctx.PushGlobalObject()
444 ctx.GetPropString(-1, "CandyJS")
445 obj := ctx.NormalizeIndex(-1)
446 ctx.PushString("_call")
447 ctx.PushPointer(ptr)
448 ctx.pushValues(in)
449 ctx.CallProp(obj, 2)
450
451 return ctx.getCallResult(t)
452 }
453}

Related snippets