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

lightningnetwork / lnd / 15951470896

29 Jun 2025 04:23AM UTC coverage: 67.594% (-0.01%) from 67.606%
15951470896

Pull #9751

github

web-flow
Merge 599d9b051 into 6290edf14
Pull Request #9751: multi: update Go to 1.23.10 and update some packages

135088 of 199851 relevant lines covered (67.59%)

21909.44 hits per line

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

100.0
/lnutils/fs.go
1
package lnutils
2

3
import (
4
        "errors"
5
        "fmt"
6
        "os"
7
)
8

9
// CreateDir creates a directory if it doesn't exist and also handles
10
// symlink-related errors with user-friendly messages. It creates all necessary
11
// parent directories with the specified permissions.
12
func CreateDir(dir string, perm os.FileMode) error {
4✔
13
        err := os.MkdirAll(dir, perm)
4✔
14
        if err == nil {
6✔
15
                return nil
2✔
16
        }
2✔
17

18
        // Show a nicer error message if it's because a symlink
19
        // is linked to a directory that does not exist
20
        // (probably because it's not mounted).
21
        var pathErr *os.PathError
2✔
22
        if errors.As(err, &pathErr) && os.IsExist(err) {
3✔
23
                link, lerr := os.Readlink(pathErr.Path)
1✔
24
                if lerr == nil {
2✔
25
                        return fmt.Errorf("is symlink %s -> %s "+
1✔
26
                                "mounted?", pathErr.Path, link)
1✔
27
                }
1✔
28
        }
29

30
        return fmt.Errorf("failed to create directory '%s': %w", dir, err)
1✔
31
}
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