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

cinode / go / 6922222242

19 Nov 2023 06:25PM UTC coverage: 95.297% (+4.4%) from 90.909%
6922222242

Pull #41

github

byo
Use random port in tests
Pull Request #41: Internal refactor

1269 of 1343 new or added lines in 38 files covered. (94.49%)

3 existing lines in 2 files now uncovered.

2999 of 3147 relevant lines covered (95.3%)

1.07 hits per line

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

86.96
/pkg/cmd/static_datastore/root.go
1
/*
2
Copyright © 2023 Bartłomiej Święcki (byo)
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package static_datastore
18

19
import (
20
        "context"
21

22
        "github.com/spf13/cobra"
23
)
24

25
// rootCmd represents the base command when called without any subcommands
26
func rootCmd() *cobra.Command {
1✔
27
        cmd := &cobra.Command{
1✔
28
                Use:   "static_datastore",
1✔
29
                Short: "Sample application to operate on static datastore",
1✔
30
                Long: `static_datastore can be used to create a simple http server serving
1✔
31
content from datastore served from encrypted datastore layer.
1✔
32

1✔
33
The first step is to generate datastore content with the 'compile'
1✔
34
command which can then be served using the 'server' command.
1✔
35

1✔
36
Note that this tool is supposed to be used for testing purposes only.
1✔
37
It does not guarantee secrecy since the encryption key for the root
1✔
38
node is stored in a plaintext in a file called 'entrypoint.txt'.
1✔
39
`,
1✔
40
                Run: func(cmd *cobra.Command, args []string) {
2✔
41
                        cmd.Help()
1✔
42
                },
1✔
43
        }
44

45
        cmd.AddCommand(compileCmd())
1✔
46

1✔
47
        return cmd
1✔
48
}
49

50
// Execute adds all child commands to the root command and sets flags appropriately.
51
// This is called by main.main(). It only needs to happen once to the rootCmd.
NEW
52
func Execute(ctx context.Context) error {
×
NEW
53
        return rootCmd().ExecuteContext(ctx)
×
UNCOV
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