Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed to handle pointer method #80

Merged
merged 1 commit into from
Dec 4, 2018

Conversation

sio4
Copy link
Member

@sio4 sio4 commented Dec 4, 2018

Hi @markbates and @stanislas-m,
I open a PR to fix the behavior of plush when we call a method of structure which has pointer receiver.
(related to gobuffalo/buffalo#1479)

When the model looks like

type Robot struct {
    name string
}

func (r *Robot) Name() string {
    return r.name
}

and we wrote templates like

<%= robot.Name() %>

in show.html which is robot is already a pointer or

<%= for (robot) in robots { %>
<%= robot.Name() %>
<% } %>

in index.html which is robot in the loop is not a pointer.

Currently, the first template works fine as user expected but the code was translated into the same result of robot.String() in second template. If this is not a designed behavior(I think so), this PR makes the same results from these two cases.

@sio4
Copy link
Member Author

sio4 commented Dec 4, 2018

FYI, One of windows test is not successfully finished with error: go: command not found

@lukasschlueter
Copy link
Contributor

FYI, One of windows test is not successfully finished with error: go: command not found

That's a problem with gimme, saw that several times now. I restarted the job, that seemed to have helped the last time.

@sio4
Copy link
Member Author

sio4 commented Dec 4, 2018

Thanks @lukasschlueter.
Yes, I also saw the failure several times and it is too slow :-)

@markbates markbates merged commit 4faa628 into gobuffalo:master Dec 4, 2018
@sio4 sio4 deleted the pointer-method branch May 14, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants