diff options
| author | 2026-03-30 05:40:58 +0000 | |
|---|---|---|
| committer | 2026-03-30 05:44:56 +0000 | |
| commit | aa7e2873aa4da53fbaa4774fdd33f5af20c1afb0 (patch) | |
| tree | 0d1367f693324ea8287ccef52ba524f8515ca146 /object/tree/path_append.go | |
| parent | README, etc.: Use proper unicode hyphens :P (diff) | |
| signature | No signature | |
object/tree: Add helpers and cleanup v0.1.152
Diffstat (limited to 'object/tree/path_append.go')
| -rw-r--r-- | object/tree/path_append.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/object/tree/path_append.go b/object/tree/path_append.go new file mode 100644 index 00000000..609d5279 --- /dev/null +++ b/object/tree/path_append.go @@ -0,0 +1,14 @@ +package tree + +// AppendPath appends path to dst as one slash-separated byte path. +func AppendPath(dst []byte, path [][]byte) []byte { + for i := range path { + if i > 0 { + dst = append(dst, '/') + } + + dst = append(dst, path[i]...) + } + + return dst +} |
