1
0
Fork 0

[golang] updated go.mod

This commit is contained in:
Julien Dessaux 2025-02-12 23:22:24 +01:00
parent 5611f5b468
commit d16dd4f38e
Signed by: adyxax
GPG key ID: F92E51B86E07177E
5 changed files with 13 additions and 10 deletions

View file

@ -8,8 +8,9 @@ import (
"os"
"os/signal"
"git.adyxax.org/adyxax/spacetraders/v2/pkg/api"
"git.adyxax.org/adyxax/spacetraders/v2/pkg/database"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/api"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/database"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/lib"
)
func main() {
@ -69,12 +70,12 @@ func run(
if err != nil {
return fmt.Errorf("failed to get agent: %w", err)
}
slog.Info("agent", "agent", agent)
slog.Info("agent", "/my/agent", agent)
default:
return fmt.Errorf("failed to register: %w\n", err)
return fmt.Errorf("failed to register: %w", err)
}
} else {
return fmt.Errorf("failed to register: %w\n", err)
return fmt.Errorf("failed to register with an invalid apiError: %w", err)
}
} else {
token, err := db.GetToken()
@ -84,6 +85,8 @@ func run(
}
client.SetToken(register.Token)
} else {
// We successfully registered but have a tainted database
slog.Error("token", "token", register.Token)
return fmt.Errorf("TODO server reset not implemented yet")
}
}

View file

@ -1,5 +1,5 @@
module git.adyxax.org/adyxax/spacetraders/v2
module git.adyxax.org/adyxax/spacetraders/golang
go 1.23.4
go 1.23.6
require github.com/mattn/go-sqlite3 v1.14.24

View file

@ -3,7 +3,7 @@ package api
import (
"net/url"
"git.adyxax.org/adyxax/spacetraders/v2/pkg/model"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
)
func (c *Client) MyAgent() (*model.Agent, error) {

View file

@ -3,7 +3,7 @@ package api
import (
"net/url"
"git.adyxax.org/adyxax/spacetraders/v2/pkg/model"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
)
func (c *Client) Register(faction, symbol string) (*model.Register, error) {

View file

@ -5,7 +5,7 @@ import (
"net/url"
"path"
"git.adyxax.org/adyxax/spacetraders/v2/pkg/model"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
)
func (c *Client) Dock(s *model.Ship) error {