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

lightningnetwork / lnd / 13980275562

20 Mar 2025 10:06PM UTC coverage: 58.6% (-10.2%) from 68.789%
13980275562

Pull #9623

github

web-flow
Merge b9b960345 into 09b674508
Pull Request #9623: Size msg test msg

0 of 1518 new or added lines in 42 files covered. (0.0%)

26603 existing lines in 443 files now uncovered.

96807 of 165200 relevant lines covered (58.6%)

1.82 hits per line

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

0.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.
UNCOV
12
func CreateDir(dir string, perm os.FileMode) error {
×
UNCOV
13
        err := os.MkdirAll(dir, perm)
×
UNCOV
14
        if err == nil {
×
UNCOV
15
                return nil
×
UNCOV
16
        }
×
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).
UNCOV
21
        var pathErr *os.PathError
×
UNCOV
22
        if errors.As(err, &pathErr) && os.IsExist(err) {
×
UNCOV
23
                link, lerr := os.Readlink(pathErr.Path)
×
UNCOV
24
                if lerr == nil {
×
UNCOV
25
                        return fmt.Errorf("is symlink %s -> %s "+
×
UNCOV
26
                                "mounted?", pathErr.Path, link)
×
UNCOV
27
                }
×
28
        }
29

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