diff --git a/go.mod b/go.mod index 277a71f..f8327f2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/COSI-Lab/Mirror/geoip +module github.com/COSI-Lab/geoip go 1.18 diff --git a/update_test.go b/update_test.go index c65bdcf..923b7f7 100644 --- a/update_test.go +++ b/update_test.go @@ -44,6 +44,7 @@ func TestDownloadDatabase(t *testing.T) { t.Error("MAXMIND_LICENSE_KEY environment variable not set") return } + // Prepare the checksum sha256, err := downloadHash(licenseKey) if err != nil { @@ -65,7 +66,11 @@ func TestDownloadDatabase(t *testing.T) { func TestLookups(t *testing.T) { // Get the license key through environment variables - licenseKey := "O1MFhnxCY9aKUyio" + licenseKey := os.Getenv("MAXMIND_LICENSE_KEY") + if licenseKey == "" { + t.Error("MAXMIND_LICENSE_KEY environment variable not set") + return + } geoip, err := NewGeoIPHandler(licenseKey) if err != nil {