• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-spatial / tegola / fa61eff93-PR-1040

19 Mar 2025 08:01AM UTC coverage: 40.442% (-0.3%) from 40.721%
fa61eff93-PR-1040

Pull #1040

github

iwpnd
chore: vendor
Pull Request #1040: refactor: drop zap and stdlogger in favour of slog

21 of 110 new or added lines in 6 files covered. (19.09%)

21 existing lines in 4 files now uncovered.

6588 of 16290 relevant lines covered (40.44%)

216.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/ui/embed.go
1
package ui
2

3
import (
4
        "embed"
5
        "io/fs"
6
        "net/http"
7
        "os"
8
        "strings"
9

10
        "github.com/go-spatial/tegola/internal/log"
11
)
12

13
// Embed UI dist Folder recursively
14
//
15
//go:embed dist/*
16
var dist embed.FS
17

18
const (
19
        distDir       = "dist"
20
        assetsDir     = "assets"
21
        indexJSPrefix = "index-"
22
)
23

24
func GetDistFileSystem() http.FileSystem {
×
25
        distFS := GetDistFS()
×
26
        return http.FS(distFS)
×
27
}
×
28

29
func GetDistFS() fs.FS {
×
30
        distFS, err := fs.Sub(dist, distDir)
×
31
        if err != nil {
×
NEW
32
                log.Error(err)
×
NEW
33
                os.Exit(1)
×
34
        }
×
35
        return distFS
×
36
}
37

38
func Version() string {
×
39
        // read the assets/ directory so we can attempt to find the built .js file
×
40
        files, err := fs.ReadDir(GetDistFS(), assetsDir)
×
41
        if err != nil {
×
42
                return ""
×
43
        }
×
44

45
        for _, entry := range files {
×
46
                name := entry.Name()
×
47
                if strings.HasPrefix(name, indexJSPrefix) && strings.HasSuffix(name, ".js") {
×
48
                        // expect it to be index-{version}.js
×
49
                        return name[len(indexJSPrefix) : len(name)-3]
×
50
                }
×
51
        }
52

53
        return ""
×
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc