Skip to content

Readme code samples print the address instead of a value #33

Description

@coud

As title says. For example this code:

import (
    "fmt"
    "gorm.io/gorm"
    "github.com/Thor-x86/nullable"
)

func main() {
    // Create new
    myBasicString := "Hello blяoW!"
    myNullableString := nullable.NewString(&myBasicString)

    // Get and print to command console
    fmt.Println(myNullableString.Get()) // Output: Hello blяoW!
}

The code will not output the string content but the address. Hence, the print needs dereference on the call to Get. Or am I doing it wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions