Skip to content

Commit

Permalink
feat: updated slog import
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahcks committed Aug 6, 2024
1 parent f28db0c commit 0ea36ac
Show file tree
Hide file tree
Showing 36 changed files with 14 additions and 1,532 deletions.
2 changes: 1 addition & 1 deletion cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"log/slog"
"os"
"os/signal"
"sync"
Expand All @@ -16,7 +17,6 @@ import (
"github.com/esfands/retpaladinbot/internal/services/helix"
"github.com/esfands/retpaladinbot/internal/services/scheduler"
"github.com/esfands/retpaladinbot/internal/services/turso"
"golang.org/x/exp/slog"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/commands/accountage/accountage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package accountage

import (
"fmt"
"log/slog"
"time"

"github.com/esfands/retpaladinbot/internal/global"
"github.com/esfands/retpaladinbot/pkg/domain"
"github.com/esfands/retpaladinbot/pkg/utils"
"github.com/gempir/go-twitch-irc/v4"
"github.com/nicklaw5/helix/v2"
"golang.org/x/exp/slog"
)

type AccountAgeCommand struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package commands
import (
"context"
"errors"
"log/slog"

"github.com/esfands/retpaladinbot/internal/bot/commands/accountage"
"github.com/esfands/retpaladinbot/internal/bot/commands/command"
Expand All @@ -19,7 +20,6 @@ import (
"github.com/esfands/retpaladinbot/internal/global"
"github.com/esfands/retpaladinbot/pkg/domain"
"github.com/esfands/retpaladinbot/pkg/utils"
"golang.org/x/exp/slog"
)

type CommandManager struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/commands/dadjoke/dadjoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"encoding/json"
"fmt"
"io"
"log/slog"
"net/http"

"github.com/dghubble/sling"
"github.com/esfands/retpaladinbot/internal/global"
"github.com/esfands/retpaladinbot/pkg/domain"
"github.com/esfands/retpaladinbot/pkg/utils"
"github.com/gempir/go-twitch-irc/v4"
"golang.org/x/exp/slog"
)

type DadJokeCommand struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/commands/uptime/uptime.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package uptime
import (
"errors"
"fmt"
"log/slog"
"time"

"github.com/esfands/retpaladinbot/internal/global"
"github.com/esfands/retpaladinbot/pkg/domain"
"github.com/esfands/retpaladinbot/pkg/utils"
"github.com/gempir/go-twitch-irc/v4"
"golang.org/x/exp/slog"
)

type UptimeCommand struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/bot/connection.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package bot

import (
"log/slog"

"github.com/esfands/retpaladinbot/config"
"github.com/esfands/retpaladinbot/internal/bot/commands"
"github.com/esfands/retpaladinbot/internal/bot/modules"
"github.com/esfands/retpaladinbot/internal/bot/variables"
"github.com/esfands/retpaladinbot/internal/global"
"github.com/gempir/go-twitch-irc/v4"
"golang.org/x/exp/slog"
)

type Connection struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package goliverightnow

import (
"fmt"
"log/slog"
"time"

"github.com/esfands/retpaladinbot/internal/global"
"github.com/gempir/go-twitch-irc/v4"
"github.com/go-co-op/gocron"
"golang.org/x/exp/slog"
)

type GoLiveRightNowModule struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/on_private_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bot

import (
"fmt"
"log/slog"
"strconv"
"strings"

Expand All @@ -12,7 +13,6 @@ import (
"github.com/esfands/retpaladinbot/pkg/domain"
"github.com/esfands/retpaladinbot/pkg/utils"
"github.com/gempir/go-twitch-irc/v4"
"golang.org/x/exp/slog"
)

func (conn *Connection) OnPrivateMessage(gctx global.Context, message twitch.PrivateMessage, commandManager *commands.CommandManager, variables variables.ServiceI) {
Expand Down
2 changes: 1 addition & 1 deletion internal/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rest
import (
"errors"
"fmt"
"log/slog"
"strings"
"time"

Expand All @@ -12,7 +13,6 @@ import (
fiber "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/logger"
"golang.org/x/exp/slog"
)

var allowedHeaders = []string{
Expand Down
2 changes: 1 addition & 1 deletion internal/rest/v1/routes/twitch/twitch.eventsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"log/slog"
"net/http"
"time"

Expand All @@ -16,7 +17,6 @@ import (
"github.com/esfands/retpaladinbot/pkg/errors"
"github.com/esfands/retpaladinbot/pkg/utils"
"github.com/nicklaw5/helix/v2"
"golang.org/x/exp/slog"
)

func (rg *RouteGroup) EventSubRecievedNotification(ctx *respond.Ctx) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/helix/helix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package helix
import (
"context"
"fmt"
"log/slog"

"github.com/esfands/retpaladinbot/internal/services/scheduler"
"github.com/nicklaw5/helix/v2"
"golang.org/x/exp/slog"
)

type SetupOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/turso/turso.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"database/sql"
"fmt"
"log/slog"
"os"

"github.com/esfands/retpaladinbot/internal/db"
_ "github.com/mattn/go-sqlite3"
_ "github.com/tursodatabase/libsql-client-go/libsql"
"golang.org/x/exp/slog"
)

type SetupOptions struct {
Expand Down
9 changes: 1 addition & 8 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ func B2S(b []byte) string {
// Note it may break if string and/or slice header will change
// in the future go versions.
func S2B(s string) (b []byte) {
/* #nosec G103 */
bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
/* #nosec G103 */
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
bh.Data = sh.Data
bh.Len = sh.Len
bh.Cap = sh.Len
return b
return unsafe.Slice(unsafe.StringData(s), len(s))
}

// IsEmptyValue uses reflection to determine if a value is empty.
Expand Down
4 changes: 0 additions & 4 deletions vendor/github.com/valyala/fasthttp/examples/README.md

This file was deleted.

This file was deleted.

This file was deleted.

132 changes: 0 additions & 132 deletions vendor/github.com/valyala/fasthttp/examples/client/client.go

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0ea36ac

Please sign in to comment.