Skip to content

Receiver method on params #1

@Asday

Description

@Asday

What's the reason for func Dashboard(w io.Writer, p DashboardParams) error instead of func (p DashboardParams) Execute(w io.Writer) error? Being able to do

	error := html.DashboardParams{
		Title:   "Dashboard",
		Message: "Hello from dashboard",
	}.execute(w)

Seems much cleaner to me.

Note: I'm a turbo beginner, I barely even know my own name. This is a genuine question 'cause I could be helped out by knowing the potential pitfalls, not some smartass looking to appear clever.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions