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

pact-foundation / pact-go / 18960674351

31 Oct 2025 02:18AM UTC coverage: 30.707% (+2.4%) from 28.272%
18960674351

Pull #455

github

YOU54F
feat: pact-go test wrapper around go test

to automatically set PACT_LD_LIBRARY_PATH
Pull Request #455: Feat/purego

384 of 512 new or added lines in 8 files covered. (75.0%)

55 existing lines in 2 files now uncovered.

2003 of 6523 relevant lines covered (30.71%)

16.44 hits per line

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

19.23
/command/install.go
1
package command
2

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

7
        "github.com/pact-foundation/pact-go/v2/installer"
8

9
        "github.com/spf13/cobra"
10
)
11

12
var libDir string
13
var force bool
14
var installCmd = &cobra.Command{
15
        Use:   "install",
16
        Short: "Install required libraries",
17
        Long:  "Install the correct version of required libraries",
18
        Run: func(cmd *cobra.Command, args []string) {
×
19
                setLogLevel(verbose, logLevel)
×
20

×
21
                // Run the installer
×
22
                i, err := installer.NewInstaller()
×
23

×
24
                if err != nil {
×
25
                        log.Println("[ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you:", err)
×
26
                        os.Exit(1)
×
27
                }
×
28

29
                if libDir != "" {
×
30
                        log.Println("[INFO] set lib dir target to", libDir)
×
31
                        i.SetLibDir(libDir)
×
32
                }
×
33

34
                i.Force(force)
×
35

×
36
                if err = i.CheckInstallation(); err != nil {
×
37
                        log.Println("[ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you:", err)
×
38
                        os.Exit(1)
×
39
                }
×
40

NEW
41
                i.SetConfigLibDir(i.GetActualLibDir())
×
42
        },
43
}
44

45
func init() {
12✔
46
        installCmd.Flags().BoolVarP(&force, "force", "f", false, "Force a new installation")
12✔
47
        installCmd.Flags().StringVarP(&libDir, "libDir", "d", "", "Target directory to install the library")
12✔
48
        RootCmd.AddCommand(installCmd)
12✔
49
}
12✔
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