summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/rules2
-rw-r--r--internal/discovery/discovery.go17
-rw-r--r--internal/discovery/discovery_embed.go19
-rw-r--r--internal/discovery/discovery_noembed.go15
4 files changed, 12 insertions, 41 deletions
diff --git a/debian/rules b/debian/rules
index 73c1724..a08002b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -28,7 +28,7 @@ override_dh_auto_build:
dh_auto_build --sourcedirectory $(PYWRAPPER_PATH)
# Make go library
- GOCACHE="/tmp" CGO_ENABLED="1" go build -o lib/libeduvpn_common-$(DEB_VERSION).so -tags=release -buildmode=c-shared ./exports
+ GOCACHE="/tmp" CGO_ENABLED="1" go build -o lib/libeduvpn_common-$(DEB_VERSION).so -buildmode=c-shared ./exports
override_dh_builddeb:
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index 93b5f4e..95b84a0 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -15,10 +15,19 @@ import (
"codeberg.org/eduVPN/eduvpn-common/internal/levenshtein"
"codeberg.org/eduVPN/eduvpn-common/internal/verify"
discotypes "codeberg.org/eduVPN/eduvpn-common/types/discovery"
+
+ _ "embed"
)
-// HasCache denotes whether or not we have an embedded cache available
-var HasCache bool
+// eServers are the embedded server list
+//
+//go:embed server_list.json
+var eServers []byte
+
+// eOrganizations are the embedded organizations
+//
+//go:embed organization_list.json
+var eOrganizations []byte
// Organizations are the list of organizations from https://disco.eduvpn.org/v2/organization_list.json
type Organizations struct {
@@ -426,10 +435,6 @@ func (discovery *Discovery) UpdateOrganizations(other Organizations) {
// Fill makes sure that the cache is filled with the embedded discovery
func (discovery *Discovery) Fill() error {
- if !HasCache {
- return nil
- }
-
discovery.mu.Lock()
defer discovery.mu.Unlock()
diff --git a/internal/discovery/discovery_embed.go b/internal/discovery/discovery_embed.go
deleted file mode 100644
index 90c731b..0000000
--- a/internal/discovery/discovery_embed.go
+++ /dev/null
@@ -1,19 +0,0 @@
-//go:build release
-
-package discovery
-
-import _ "embed"
-
-// eServers are the embedded server list
-//
-//go:embed server_list.json
-var eServers []byte
-
-// eOrganizations are the embedded organizations
-//
-//go:embed organization_list.json
-var eOrganizations []byte
-
-func init() {
- HasCache = true
-}
diff --git a/internal/discovery/discovery_noembed.go b/internal/discovery/discovery_noembed.go
deleted file mode 100644
index 0c8e8e8..0000000
--- a/internal/discovery/discovery_noembed.go
+++ /dev/null
@@ -1,15 +0,0 @@
-//go:build !release
-
-package discovery
-
-// eServers are the embedded server list
-// In this case this is empty because we do not embed during development
-var eServers []byte
-
-// eOrganizations are the embedded organizations
-// In this case this is empty because we do not embed during development
-var eOrganizations []byte
-
-func init() {
- HasCache = false
-}