Skip to content

Commit c76ca35

Browse files
committed
fix(verity-go): correct README examples and module path
- Fix CLI flag: use -m (metadata output) instead of --hash-output which only outputs the root hash - Remove unused Go imports (fmt in serialize example, encoding/hex in deserialize example) that would cause compilation failure - Set module name to github.com/openanolis/cryptpilot/verity-go so go get import paths match the README documentation - Update all internal import paths to match the new module name
1 parent f78773d commit c76ca35

7 files changed

Lines changed: 8 additions & 12 deletions

File tree

verity-go/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ compute fs-verity for each file, build the Merkle tree, and write the FlatBuffer
3030
metadata file:
3131

3232
```bash
33-
cargo run -p cryptpilot-verity -- format /path/to/dir --label env=prod --hash-output metadata.fb
33+
cargo run -p cryptpilot-verity -- format /path/to/dir --label env=prod -m metadata.fb
3434
```
3535

3636
#### Option B: Go implementation
@@ -42,7 +42,6 @@ package main
4242

4343
import (
4444
"encoding/hex"
45-
"fmt"
4645
"os"
4746

4847
"github.com/openanolis/cryptpilot/verity-go/metadata"
@@ -76,7 +75,6 @@ are available:
7675
package main
7776

7877
import (
79-
"encoding/hex"
8078
"fmt"
8179
"os"
8280

verity-go/README_CN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Rust `cryptpilot-verity` CLI 可自动完成完整流程 — 遍历目录、
2929
计算每个文件的 fs-verity、构建 Merkle 树、输出 FlatBuffers 元数据文件:
3030

3131
```bash
32-
cargo run -p cryptpilot-verity -- format /path/to/dir --label env=prod --hash-output metadata.fb
32+
cargo run -p cryptpilot-verity -- format /path/to/dir --label env=prod -m metadata.fb
3333
```
3434

3535
#### 方式 B:Go 代码实现
@@ -41,7 +41,6 @@ package main
4141

4242
import (
4343
"encoding/hex"
44-
"fmt"
4544
"os"
4645

4746
"github.com/openanolis/cryptpilot/verity-go/metadata"
@@ -74,7 +73,6 @@ func main() {
7473
package main
7574

7675
import (
77-
"encoding/hex"
7876
"fmt"
7977
"os"
8078

verity-go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module cryptpilot-verity-go
1+
module github.com/openanolis/cryptpilot/verity-go
22

33
go 1.24
44

verity-go/metadata/interop_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"runtime"
1111
"testing"
1212

13-
"cryptpilot-verity-go/verity"
13+
"github.com/openanolis/cryptpilot/verity-go/verity"
1414
)
1515

1616
// expectedDescriptorHashes maps test file name to expected SHA-256 descriptor hash.

verity-go/metadata/metadata.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"fmt"
77
"sort"
88

9-
"cryptpilot-verity-go/metadata/generated"
10-
"cryptpilot-verity-go/verity"
9+
"github.com/openanolis/cryptpilot/verity-go/metadata/generated"
10+
"github.com/openanolis/cryptpilot/verity-go/verity"
1111

1212
flatbuffers "github.com/google/flatbuffers/go"
1313
)

verity-go/metadata/metadata_hash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/hex"
77
"fmt"
88

9-
"cryptpilot-verity-go/metadata/generated"
9+
"github.com/openanolis/cryptpilot/verity-go/metadata/generated"
1010

1111
flatbuffers "github.com/google/flatbuffers/go"
1212
)

verity-go/metadata/metadata_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/hex"
77
"testing"
88

9-
"cryptpilot-verity-go/verity"
9+
"github.com/openanolis/cryptpilot/verity-go/verity"
1010
)
1111

1212
func makeTestFileVerityInfo(path string, data []byte) FileVerityInfo {

0 commit comments

Comments
 (0)