💬 Align output format
This commit is contained in:
1 parent
575e4a947c
commit
ad22b2aec5
12 files changed
+17
-17
No files matched your search
+4
-4
@@ -126,7 +126,7 @@ func startWebServer(redirectURL string) chan string {
|
||||
_ = listener.Close()
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
_, _ = fmt.Fprintf(
|
||||
w, "Received code: %v\r\nYou can now safely close this window.", code,
|
||||
w, "Received code: %s\r\nYou can now safely close this window.", code,
|
||||
)
|
||||
},
|
||||
),
|
||||
@@ -138,7 +138,7 @@ func startWebServer(redirectURL string) chan string {
|
||||
func getCodeFromPrompt(authURL string) (code string) {
|
||||
fmt.Printf(
|
||||
"It seems that your browser is not open. Go to the following "+
|
||||
"link in your browser:\n%v\n", authURL,
|
||||
"link in your browser:\n%s\n", authURL,
|
||||
)
|
||||
fmt.Print(manualInputHint)
|
||||
_, err := fmt.Scan(&code)
|
||||
@@ -159,7 +159,7 @@ func getTokenFromWeb(config *oauth2.Config, authURL string) *oauth2.Token {
|
||||
if err := utils.OpenURL(authURL); err == nil {
|
||||
fmt.Printf(
|
||||
"Your browser has been opened to an authorization URL. This "+
|
||||
"program will resume once authorization has been provided.\n%v\n",
|
||||
"program will resume once authorization has been provided.\n%s\n",
|
||||
authURL,
|
||||
)
|
||||
code = <-codeCh
|
||||
@@ -169,7 +169,7 @@ func getTokenFromWeb(config *oauth2.Config, authURL string) *oauth2.Token {
|
||||
code = getCodeFromPrompt(authURL)
|
||||
}
|
||||
|
||||
fmt.Printf("Authorization code generated: %v\n", code)
|
||||
fmt.Printf("Authorization code generated: %s\n", code)
|
||||
token, err := config.Exchange(context.TODO(), code)
|
||||
if err != nil {
|
||||
log.Fatalln(errors.Join(errExchange, err))
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ const missingClientSecretsHint string = `
|
||||
Please configure OAuth 2.0
|
||||
To make this sample run, you need to populate the client_secrets.json file
|
||||
found at:
|
||||
%v
|
||||
%s
|
||||
with information from the {{ Google Cloud Console }}
|
||||
{{ https://cloud.google.com/console }}
|
||||
For more information about the client_secrets.json file format, please visit:
|
||||
|
||||
@@ -83,7 +83,7 @@ func (cs *channelSection) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(channelSections, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "ID\tChannelID\tTitle")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tChannelId\tTitle")
|
||||
for _, channelSection := range channelSections {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%s\t%s\t%s\n", channelSection.Id,
|
||||
|
||||
@@ -109,7 +109,7 @@ func (c *commentThread) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(commentThreads, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "ID\tTopLevelCommentID")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tTopLevelCommentId")
|
||||
for _, commentThread := range commentThreads {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%s\t%s\n",
|
||||
|
||||
@@ -63,10 +63,10 @@ func (i *i18nLanguage) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(i18nLanguages, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "id\thl\tname")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tHl\tName")
|
||||
for _, i18nLanguage := range i18nLanguages {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%v\t%v\t%v\n",
|
||||
writer, "%s\t%s\t%s\n",
|
||||
i18nLanguage.Id, i18nLanguage.Snippet.Hl, i18nLanguage.Snippet.Name,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -63,10 +63,10 @@ func (i *i18nRegion) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(i18nRegions, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "ID\tgl\tname")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tGl\tName")
|
||||
for _, i18nRegion := range i18nRegions {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%v\t%v\t%v\n",
|
||||
writer, "%s\t%s\t%s\n",
|
||||
i18nRegion.Id, i18nRegion.Snippet.Gl, i18nRegion.Snippet.Name,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func (m *member) List(parts []string, output string, writer io.Writer) error {
|
||||
case "yaml":
|
||||
utils.PrintYAML(members, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "channelId\tdisplayName")
|
||||
_, _ = fmt.Fprintln(writer, "ChannelId\tDisplayName")
|
||||
for _, member := range members {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%s\t%s\n",
|
||||
|
||||
@@ -59,7 +59,7 @@ func (m *membershipsLevel) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(membershipsLevels, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "id\tdisplayName")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tDisplayName")
|
||||
for _, membershipsLevel := range membershipsLevels {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%v\t%v\n", membershipsLevel.Id,
|
||||
|
||||
@@ -91,7 +91,7 @@ func (pi *playlistImage) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(playlistImages, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "ID\tKind\tPlaylistID\tType")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tKind\tPlaylistId\tType")
|
||||
for _, image := range playlistImages {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer,
|
||||
|
||||
@@ -205,7 +205,7 @@ func (s *search) List(parts []string, output string, writer io.Writer) error {
|
||||
_, _ = fmt.Fprintln(writer, "Kind\tTitle")
|
||||
for _, result := range results {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%v\t%v\n", result.Id.Kind, result.Snippet.Title,
|
||||
writer, "%s\t%s\n", result.Id.Kind, result.Snippet.Title,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ func (s *subscription) List(
|
||||
case "yaml":
|
||||
utils.PrintYAML(subscriptions, writer)
|
||||
default:
|
||||
_, _ = fmt.Fprintln(writer, "ID\tChannel ID\tChannel Title")
|
||||
_, _ = fmt.Fprintln(writer, "ID\tChannelId\tChannelTitle")
|
||||
for _, subscription := range subscriptions {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%s\t%s\t%s\n", subscription.Id,
|
||||
|
||||
@@ -71,7 +71,7 @@ func (s *superChatEvent) List(
|
||||
_, _ = fmt.Fprintln(writer, "ID\tAmount")
|
||||
for _, event := range events {
|
||||
_, _ = fmt.Fprintf(
|
||||
writer, "%v\t%v\n", event.Id, event.Snippet.AmountMicros,
|
||||
writer, "%s\t%d\n", event.Id, event.Snippet.AmountMicros,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user