summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-06-11 23:09:52 -0400
committerdemo <demo@antix1>2026-06-11 23:09:52 -0400
commit99bdb743b10cfbe746e845967ebbd4de06a9c49a (patch)
tree1677ac7b75eafa3ff343533ea0c1bc32e2b6f78c
parent3a8154d11816476fec3e74bb69f965d45f380d9c (diff)
feat: set shortcode filename inside a constant
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 2b072b3..db8cd3d 100644
--- a/main.go
+++ b/main.go
@@ -16,6 +16,8 @@ import (
"github.com/urfave/cli/v3"
)
+const shortcodeFilename = "urls.csv"
+
func main() {
if os.Getenv("GOEXPERIMENT") != "goroutineleakprofile" {
log.Fatal("Missing GOEXPERIMENT=goroutineleakprofile environment setting")
@@ -74,8 +76,7 @@ func main() {
},
Action: func(ctx context.Context, cmd *cli.Command) error {
if shortcode := cmd.String("shortcode"); shortcode != "" {
- // FIXME: shortcode filename is hardcoded for now.
- rawURL, err := getURLFromShortcode("urls.csv", shortcode)
+ rawURL, err := getURLFromShortcode(shortcodeFilename, shortcode)
if err != nil {
return err
}