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

mlange-42 / modo / 12829003556

17 Jan 2025 12:24PM CUT coverage: 56.552% (+20.0%) from 36.563%
12829003556

Pull #54

github

web-flow
Merge 1a1b11cc2 into 41ff6f833
Pull Request #54: More unit tests

32 of 49 new or added lines in 4 files covered. (65.31%)

13 existing lines in 2 files now uncovered.

725 of 1282 relevant lines covered (56.55%)

6.69 hits per line

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

0.0
/format/formats.go
1
package format
2

3
import (
4
        "fmt"
5

6
        "github.com/mlange-42/modo/document"
7
)
8

9
type Format uint8
10

11
const (
12
        Plain Format = iota
13
        MdBook
14
        Hugo
15
)
16

17
func GetFormat(f string) (Format, error) {
×
18
        fm, ok := formats[f]
×
19
        if !ok {
×
20
                return Plain, fmt.Errorf("unknown format '%s'. See flag --format", f)
×
21
        }
×
22
        return fm, nil
×
23
}
24

25
var formats = map[string]Format{
26
        "":       Plain,
27
        "plain":  Plain,
28
        "mdbook": MdBook,
29
        "hugo":   Hugo,
30
}
31

32
var formatters = []document.Formatter{
33
        &PlainFormatter{},
34
        &MdBookFormatter{},
35
        &HugoFormatter{},
36
}
37

UNCOV
38
func GetFormatter(f Format) document.Formatter {
×
UNCOV
39
        return formatters[f]
×
40
}
×
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

© 2025 Coveralls, Inc