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

cinode / go / 3736023969

19 Dec 2022 11:26PM UTC coverage: 79.498%. First build
3736023969

push

github

Bartek
Basic test for the static_datastore binary

919 of 1156 relevant lines covered (79.5%)

0.87 hits per line

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

0.0
/cmd/static_datastore/cmd/root.go
1
package cmd
2

3
import (
4
        "fmt"
5
        "os"
6

7
        "github.com/spf13/cobra"
8
)
9

10
// rootCmd represents the base command when called without any subcommands
11
func rootCmd() *cobra.Command {
×
12
        cmd := &cobra.Command{
×
13
                Use:   "static_datastore",
×
14
                Short: "Sample application to operate on static datastore",
×
15
                Long: `static_datastore can be used to create a simple http server serving
×
16
content from datastore served from encrypted datastore layer.
×
17

×
18
The first step is to generate datastore content with the 'compile'
×
19
command which can then be served using the 'server' command.
×
20

×
21
Note that this tool is supposed to be used for testing purposes only.
×
22
It does not guarantee secrecy since the encryption key for the root
×
23
node is stored in a plaintext in a file called 'entrypoint.txt'.
×
24
`,
×
25
                Run: func(cmd *cobra.Command, args []string) {
×
26
                        cmd.Help()
×
27
                },
×
28
        }
29

30
        cmd.AddCommand(compileCmd())
×
31
        cmd.AddCommand(serverCmd())
×
32

×
33
        return cmd
×
34
}
35

36
// Execute adds all child commands to the root command and sets flags appropriately.
37
// This is called by main.main(). It only needs to happen once to the rootCmd.
38
func Execute() {
×
39
        if err := rootCmd().Execute(); err != nil {
×
40
                fmt.Println(err)
×
41
                os.Exit(1)
×
42
        }
×
43
}
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