Skip to content

Commit 18cc09d

Browse files
committed
chore: move settings.go into main api folder to prevent circular dep imports
1 parent 1b2748c commit 18cc09d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

api/rest.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ import (
2525
"strings"
2626
"time"
2727

28-
"github.com/veteran-software/discord-api-wrapper/logging"
29-
"github.com/veteran-software/discord-api-wrapper/utilities"
30-
3128
"github.com/gojek/heimdall/v7"
3229
"github.com/gojek/heimdall/v7/httpclient"
30+
"github.com/veteran-software/discord-api-wrapper/logging"
3331
)
3432

3533
//goland:noinspection SpellCheckingInspection
@@ -104,7 +102,7 @@ func (r *RateLimiter) lockedRequest(method, route, contentType string, b interfa
104102
return nil, err
105103
}
106104

107-
req.Header.Set(http.CanonicalHeaderKey("Authorization"), fmt.Sprintf("Bot %s", utilities.Token))
105+
req.Header.Set(http.CanonicalHeaderKey("Authorization"), fmt.Sprintf("Bot %s", Token))
108106

109107
if b != nil {
110108
req.Header.Set(http.CanonicalHeaderKey("Content-Type"), contentType)

utilities/settings.go renamed to api/settings.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
* If not, see <http://www.gnu.org/licenses/>.
1515
*/
1616

17-
package utilities
17+
package api
18+
19+
import (
20+
"github.com/sirupsen/logrus"
21+
)
1822

1923
//goland:noinspection GoUnusedGlobalVariable
2024
var (
25+
ApplicationID Snowflake // ApplicationID - The Snowflake of the application
26+
DefaultColor int64 = 16711680
27+
LogLevel logrus.Level
2128
Token string // Token - The application's token
22-
ApplicationID string // ApplicationID - The Snowflake of the application
2329
)

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package main
1919
import (
2020
_ "github.com/veteran-software/discord-api-wrapper/api"
2121
_ "github.com/veteran-software/discord-api-wrapper/logging"
22-
_ "github.com/veteran-software/discord-api-wrapper/utilities"
22+
_ "github.com/veteran-software/discord-api-wrapper/settings"
2323
)
2424

2525
func main() {

0 commit comments

Comments
 (0)