Original post

Hi,

The caller. will never need to modify result var so I believe what I am doing in result.go by dereferencing result var is “good”. Am I correct to assume this? Came to conclusion after reading https://github.com/golang/go/wiki/CodeReviewComments#receiver-type

Thanks

// result.go
func NewResult(user entity.User) Result {
	result := &Result{}

    // Updating all properties of `result` coming from `user`.
    // result.... = user....
    
	return *result
}
// caller.go
func main() {
    result := result.NewResult(User{//....})

    // Do something with `result` but don't modify it.
    
    fmt.Println(result)
}