Skip to content

Commit e655a21

Browse files
committed
Use new-style octal constants
1 parent bf222ed commit e655a21

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/testutils/repoutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (repo *TestRepo) AddFile(t *testing.T, relativePath, contents string) {
216216
if dirPath != "." {
217217
require.NoError(
218218
t,
219-
os.MkdirAll(filepath.Join(repo.Path, dirPath), 0777),
219+
os.MkdirAll(filepath.Join(repo.Path, dirPath), 0o777),
220220
"creating subdir",
221221
)
222222
}

sizes/graph.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ func (r *treeRecord) initialize(g *Graph, oid git.OID, tree *git.Tree) error {
571571
name := entry.Name
572572

573573
switch {
574-
case entry.Filemode&0170000 == 0040000:
574+
case entry.Filemode&0o170000 == 0o40000:
575575
// Tree
576576
listener := func(size TreeSize) {
577577
// This listener is called when the tree pointed to by
@@ -595,12 +595,12 @@ func (r *treeRecord) initialize(g *Graph, oid git.OID, tree *git.Tree) error {
595595
}
596596
r.entryCount.Increment(1)
597597

598-
case entry.Filemode&0170000 == 0160000:
598+
case entry.Filemode&0o170000 == 0o160000:
599599
// Commit (i.e., submodule)
600600
r.size.addSubmodule(name)
601601
r.entryCount.Increment(1)
602602

603-
case entry.Filemode&0170000 == 0120000:
603+
case entry.Filemode&0o170000 == 0o120000:
604604
// Symlink
605605
g.pathResolver.RecordTreeEntry(oid, name, entry.OID)
606606

0 commit comments

Comments
 (0)