extract

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64

func Int64(pointer *int64) int64

Int64 safely dereferences an int64 pointer, returning the value or 0 if nil.

This helper function provides nil-safety when working with optional numeric fields:

  • If pointer is non-nil: returns the underlying int64 value
  • If pointer is nil: returns 0 (zero value for int64)

Useful when working with optional int64 fields in structs or API responses.

func IsEmptyString

func IsEmptyString(pointer *string) bool

IsEmptyString checks if a string pointer is nil or points to an empty string. Returns true if either:

  • The pointer is nil
  • The dereferenced string is empty ("")

Useful for safely checking optional string fields that may be nil.

func String

func String(pointer *string) string

String safely dereferences a string pointer, returning the string value or empty string if nil. This provides a nil-safe way to access string pointers and ensures you always get a valid string:

  • If pointer is non-nil: returns the underlying string value
  • If pointer is nil: returns an empty string ("")

Useful when working with optional string fields in structs or API responses.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL