Skip to content

Commit 042f531

Browse files
committed
examples: Initialize provider title map instead adding values one by one
It's much more readable this way. And, technically, more resource efficient (on my system, ~-59% sec/op, ~-51% B/op, -2/3 allocs/op). Although — who cares — this only runs once and in an example.
1 parent aeec8c8 commit 042f531

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

examples/main.go

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -159,68 +159,68 @@ func main() {
159159
goth.UseProviders(openidConnect)
160160
}
161161

162-
m := make(map[string]string)
163-
m["amazon"] = "Amazon"
164-
m["apple"] = "Apple"
165-
m["auth0"] = "Auth0"
166-
m["azuread"] = "Azure AD"
167-
m["battlenet"] = "Battlenet"
168-
m["bitbucket"] = "Bitbucket"
169-
m["box"] = "Box"
170-
m["dailymotion"] = "Dailymotion"
171-
m["deezer"] = "Deezer"
172-
m["digitalocean"] = "Digital Ocean"
173-
m["discord"] = "Discord"
174-
m["dropbox"] = "Dropbox"
175-
m["eveonline"] = "Eve Online"
176-
m["facebook"] = "Facebook"
177-
m["fitbit"] = "Fitbit"
178-
m["gitea"] = "Gitea"
179-
m["github"] = "Github"
180-
m["gitlab"] = "Gitlab"
181-
m["google"] = "Google"
182-
m["gplus"] = "Google Plus"
183-
m["heroku"] = "Heroku"
184-
m["instagram"] = "Instagram"
185-
m["intercom"] = "Intercom"
186-
m["kakao"] = "Kakao"
187-
m["lastfm"] = "Last FM"
188-
m["line"] = "LINE"
189-
m["linkedin"] = "Linkedin"
190-
m["mastodon"] = "Mastodon"
191-
m["meetup"] = "Meetup.com"
192-
m["microsoftonline"] = "Microsoft Online"
193-
m["naver"] = "Naver"
194-
m["nextcloud"] = "NextCloud"
195-
m["okta"] = "Okta"
196-
m["onedrive"] = "Onedrive"
197-
m["openid-connect"] = "OpenID Connect"
198-
m["patreon"] = "Patreon"
199-
m["paypal"] = "Paypal"
200-
m["salesforce"] = "Salesforce"
201-
m["seatalk"] = "SeaTalk"
202-
m["shopify"] = "Shopify"
203-
m["slack"] = "Slack"
204-
m["soundcloud"] = "SoundCloud"
205-
m["spotify"] = "Spotify"
206-
m["steam"] = "Steam"
207-
m["strava"] = "Strava"
208-
m["stripe"] = "Stripe"
209-
m["tiktok"] = "TikTok"
210-
m["twitch"] = "Twitch"
211-
m["twitter"] = "Twitter"
212-
m["twitterv2"] = "Twitter"
213-
m["typetalk"] = "Typetalk"
214-
m["uber"] = "Uber"
215-
m["vk"] = "VK"
216-
m["wecom"] = "WeCom"
217-
m["wepay"] = "Wepay"
218-
m["xero"] = "Xero"
219-
m["yahoo"] = "Yahoo"
220-
m["yammer"] = "Yammer"
221-
m["yandex"] = "Yandex"
222-
m["zoom"] = "Zoom"
223-
162+
m := map[string]string{
163+
"amazon": "Amazon",
164+
"apple": "Apple",
165+
"auth0": "Auth0",
166+
"azuread": "Azure AD",
167+
"battlenet": "Battlenet",
168+
"bitbucket": "Bitbucket",
169+
"box": "Box",
170+
"dailymotion": "Dailymotion",
171+
"deezer": "Deezer",
172+
"digitalocean": "Digital Ocean",
173+
"discord": "Discord",
174+
"dropbox": "Dropbox",
175+
"eveonline": "Eve Online",
176+
"facebook": "Facebook",
177+
"fitbit": "Fitbit",
178+
"gitea": "Gitea",
179+
"github": "Github",
180+
"gitlab": "Gitlab",
181+
"google": "Google",
182+
"gplus": "Google Plus",
183+
"heroku": "Heroku",
184+
"instagram": "Instagram",
185+
"intercom": "Intercom",
186+
"kakao": "Kakao",
187+
"lastfm": "Last FM",
188+
"line": "LINE",
189+
"linkedin": "Linkedin",
190+
"mastodon": "Mastodon",
191+
"meetup": "Meetup.com",
192+
"microsoftonline": "Microsoft Online",
193+
"naver": "Naver",
194+
"nextcloud": "NextCloud",
195+
"okta": "Okta",
196+
"onedrive": "Onedrive",
197+
"openid-connect": "OpenID Connect",
198+
"patreon": "Patreon",
199+
"paypal": "Paypal",
200+
"salesforce": "Salesforce",
201+
"seatalk": "SeaTalk",
202+
"shopify": "Shopify",
203+
"slack": "Slack",
204+
"soundcloud": "SoundCloud",
205+
"spotify": "Spotify",
206+
"steam": "Steam",
207+
"strava": "Strava",
208+
"stripe": "Stripe",
209+
"tiktok": "TikTok",
210+
"twitch": "Twitch",
211+
"twitter": "Twitter",
212+
"twitterv2": "Twitter",
213+
"typetalk": "Typetalk",
214+
"uber": "Uber",
215+
"vk": "VK",
216+
"wecom": "WeCom",
217+
"wepay": "Wepay",
218+
"xero": "Xero",
219+
"yahoo": "Yahoo",
220+
"yammer": "Yammer",
221+
"yandex": "Yandex",
222+
"zoom": "Zoom",
223+
}
224224
var keys []string
225225
for k := range m {
226226
keys = append(keys, k)

0 commit comments

Comments
 (0)