From 59856a9fcf84db31d7bdf4d5e973dffae0fa83e4 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 2 Sep 2023 12:55:20 +0200 Subject: [PATCH] fix(ci): run gofmt These are changes from 1.18 to 1.21 --- discord.go | 7 +++++-- discord_test.go | 4 ++-- event.go | 10 ++++++---- logging.go | 9 +++++---- oauth2.go | 16 ++++++++++------ state.go | 5 +++-- wsapi.go | 16 ++++++++-------- 7 files changed, 39 insertions(+), 28 deletions(-) diff --git a/discord.go b/discord.go index 584e567df..faf386110 100644 --- a/discord.go +++ b/discord.go @@ -26,9 +26,12 @@ const VERSION = "0.27.1" // New creates a new Discord session with provided token. // If the token is for a bot, it must be prefixed with "Bot " -// e.g. "Bot ..." +// +// e.g. "Bot ..." +// // Or if it is an OAuth2 token, it must be prefixed with "Bearer " -// e.g. "Bearer ..." +// +// e.g. "Bearer ..." func New(token string) (s *Session, err error) { // Create an empty Session interface. diff --git a/discord_test.go b/discord_test.go index df5239785..49f8ca417 100644 --- a/discord_test.go +++ b/discord_test.go @@ -9,8 +9,8 @@ import ( "time" ) -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////// VARS NEEDED FOR TESTING +// //////////////////////////////////////////////////////////////////////////// +// //////////////////////////////////////////////////// VARS NEEDED FOR TESTING var ( dg *Session // Stores a global discordgo user session dgBot *Session // Stores a global discordgo bot session diff --git a/event.go b/event.go index 84dbdc7fb..941085d70 100644 --- a/event.go +++ b/event.go @@ -102,12 +102,14 @@ func (s *Session) addEventHandlerOnce(eventHandler EventHandler) func() { // to a struct corresponding to the event for which you want to listen. // // eg: -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) { -// }) +// +// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) { +// }) // // or: -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) { -// }) +// +// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) { +// }) // // List of events can be found at this page, with corresponding names in the // library for each event: https://discord.com/developers/docs/topics/gateway#event-names diff --git a/logging.go b/logging.go index b798d3e87..ffb9342c1 100644 --- a/logging.go +++ b/logging.go @@ -39,10 +39,11 @@ var Logger func(msgL, caller int, format string, a ...interface{}) // msglog provides package wide logging consistency for discordgo // the format, a... portion this command follows that of fmt.Printf -// msgL : LogLevel of the message -// caller : 1 + the number of callers away from the message source -// format : Printf style message format -// a ... : comma separated list of values to pass +// +// msgL : LogLevel of the message +// caller : 1 + the number of callers away from the message source +// format : Printf style message format +// a ... : comma separated list of values to pass func msglog(msgL, caller int, format string, a ...interface{}) { if Logger != nil { diff --git a/oauth2.go b/oauth2.go index 2fa2d8d54..492aa4174 100644 --- a/oauth2.go +++ b/oauth2.go @@ -41,7 +41,8 @@ type Team struct { } // Application returns an Application structure of a specific Application -// appID : The ID of an Application +// +// appID : The ID of an Application func (s *Session) Application(appID string) (st *Application, err error) { body, err := s.RequestWithBucketID("GET", EndpointOAuth2Application(appID), nil, EndpointOAuth2Application("")) @@ -66,8 +67,9 @@ func (s *Session) Applications() (st []*Application, err error) { } // ApplicationCreate creates a new Application -// name : Name of Application / Bot -// uris : Redirect URIs (Not required) +// +// name : Name of Application / Bot +// uris : Redirect URIs (Not required) func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error) { data := struct { @@ -85,7 +87,8 @@ func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error } // ApplicationUpdate updates an existing Application -// var : desc +// +// var : desc func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Application, err error) { data := struct { @@ -103,7 +106,8 @@ func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Applicat } // ApplicationDelete deletes an existing Application -// appID : The ID of an Application +// +// appID : The ID of an Application func (s *Session) ApplicationDelete(appID string) (err error) { _, err = s.RequestWithBucketID("DELETE", EndpointOAuth2Application(appID), nil, EndpointOAuth2Application("")) @@ -139,7 +143,7 @@ func (s *Session) ApplicationAssets(appID string) (ass []*Asset, err error) { // ApplicationBotCreate creates an Application Bot Account // -// appID : The ID of an Application +// appID : The ID of an Application // // NOTE: func name may change, if I can think up something better. func (s *Session) ApplicationBotCreate(appID string) (st *User, err error) { diff --git a/state.go b/state.go index d0c7b4222..92e3825f7 100644 --- a/state.go +++ b/state.go @@ -175,8 +175,9 @@ func (s *State) GuildRemove(guild *Guild) error { // Guild gets a guild by ID. // Useful for querying if @me is in a guild: -// _, err := discordgo.Session.State.Guild(guildID) -// isInGuild := err == nil +// +// _, err := discordgo.Session.State.Guild(guildID) +// isInGuild := err == nil func (s *State) Guild(guildID string) (*Guild, error) { if s == nil { return nil, ErrNilState diff --git a/wsapi.go b/wsapi.go index f63cfdbe0..542df94cb 100644 --- a/wsapi.go +++ b/wsapi.go @@ -682,10 +682,10 @@ type voiceChannelJoinOp struct { // ChannelVoiceJoin joins the session user to a voice channel. // -// gID : Guild ID of the channel to join. -// cID : Channel ID of the channel to join. -// mute : If true, you will be set to muted upon joining. -// deaf : If true, you will be set to deafened upon joining. +// gID : Guild ID of the channel to join. +// cID : Channel ID of the channel to join. +// mute : If true, you will be set to muted upon joining. +// deaf : If true, you will be set to deafened upon joining. func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *VoiceConnection, err error) { s.log(LogInformational, "called") @@ -729,10 +729,10 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi // // This should only be used when the VoiceServerUpdate will be intercepted and used elsewhere. // -// gID : Guild ID of the channel to join. -// cID : Channel ID of the channel to join, leave empty to disconnect. -// mute : If true, you will be set to muted upon joining. -// deaf : If true, you will be set to deafened upon joining. +// gID : Guild ID of the channel to join. +// cID : Channel ID of the channel to join, leave empty to disconnect. +// mute : If true, you will be set to muted upon joining. +// deaf : If true, you will be set to deafened upon joining. func (s *Session) ChannelVoiceJoinManual(gID, cID string, mute, deaf bool) (err error) { s.log(LogInformational, "called")