chore(tfstated): code cleanup

This commit is contained in:
Julien Dessaux 2025-01-02 18:23:04 +01:00
parent 65e66b5e38
commit 99ff8441da
Signed by: adyxax
GPG key ID: F92E51B86E07177E
2 changed files with 1 additions and 14 deletions

View file

@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"io"
"log/slog"
"os"
"os/signal"
@ -12,16 +11,13 @@ import (
"git.adyxax.org/adyxax/tfstated/pkg/backend"
"git.adyxax.org/adyxax/tfstated/pkg/database"
"git.adyxax.org/adyxax/tfstated/pkg/webui"
)
func run(
ctx context.Context,
db *database.DB,
//args []string,
getenv func(string) string,
//stdin io.Reader,
//stdout io.Writer,
stderr io.Writer,
) error {
ctx, cancel := signal.NotifyContext(ctx, os.Interrupt)
defer cancel()
@ -79,11 +75,7 @@ func main() {
if err := run(
ctx,
db,
//os.Args,
os.Getenv,
//os.Stdin,
//os.Stdout,
os.Stderr,
); err != nil {
fmt.Fprintf(os.Stderr, "%+v\n", err)
os.Exit(1)

View file

@ -2,7 +2,6 @@ package backend
import (
"context"
"io"
"log/slog"
"net"
"net/http"
@ -14,11 +13,7 @@ import (
func Run(
ctx context.Context,
db *database.DB,
//args []string,
getenv func(string) string,
//stdin io.Reader,
//stdout io.Writer,
stderr io.Writer,
) *http.Server {
mux := http.NewServeMux()
addRoutes(