Skip to content

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

@coud

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?

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