Skip to content

Commit

Permalink
Merge pull request #53 from Esfands/52-upgrade-to-go1220
Browse files Browse the repository at this point in the history
feat: upgrade to go1.22.0
  • Loading branch information
Mahcks authored Aug 6, 2024
2 parents bf0b226 + 0ea36ac commit c6d2178
Show file tree
Hide file tree
Showing 39 changed files with 17 additions and 1,535 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/.publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@v2
with:
go-version: '1.20'
go-version: '1.22'

- name: Setup private Go modules
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Go image tag
ARG GOLANG_TAG=1.20-bullseye
ARG GOLANG_TAG=1.22-bullseye

FROM golang:$GOLANG_TAG as builder

Expand Down
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 go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/esfands/retpaladinbot

go 1.20
go 1.22.0

require (
github.com/dghubble/sling v1.4.2
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 c6d2178

Please sign in to comment.