Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Order main.go by vars, funcs, types #16

Merged
merged 1 commit into from
Jan 20, 2016
Merged

Order main.go by vars, funcs, types #16

merged 1 commit into from
Jan 20, 2016

Conversation

croaky
Copy link
Contributor

@croaky croaky commented Jan 20, 2016

This is the same order outputted by Godoc:
https://godoc.org/golang.org/x/tools/cmd/godoc

Example:
https://golang.org/pkg/os/

func stripPodcastEpisodePrefix(s string) string {
return podcastEpisodePrefix.ReplaceAllString(s, "")
}

type byCreated []*feeds.Item
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should still be on top of the byCreated methods.

@bernerdschaefer
Copy link
Contributor

One comment. Looks great! 👍

{uri: "http://simplecast.fm/podcasts/282/rss", name: "The Bike Shed podcast"},
{uri: "http://simplecast.fm/podcasts/1088/rss", name: "Tentative podcast"},
{uri: "https://upcase.com/the-weekly-iteration.rss", name: "The Weekly Iteration videos"},
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bernerdschaefer is it more idiomatic for this to be a constant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the value were a string or number, then probably so. But slices can't be constants, so var is correct.

This is the same order outputted by Godoc:
https://godoc.org/golang.org/x/tools/cmd/godoc

Example:
https://golang.org/pkg/os/

Except, put the methods right after the type.
@croaky croaky merged commit 8ac7f38 into master Jan 20, 2016
@croaky croaky deleted the order branch January 20, 2016 20:07
@croaky croaky temporarily deployed to thoughtbot-rss January 20, 2016 20:08 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants