diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-26 16:20:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-26 16:23:15 +0900 |
| commit | 2548a681e9a1e28c52805397edeccf719ec8ab45 (patch) | |
| tree | 06202347c5762d8c1e05e4cc668829e633411d2c /internal/rosa/rosa.go | |
| parent | d514d0679fcd947cd10f7ba9d0418855515c19d5 (diff) | |
internal/rosa: key-value type
This type is used very frequently. The new type is much easier to type and can receive helper methods eventually if needed.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index b6a2c023..3b05b368 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -37,6 +37,9 @@ func mustDecode(s string) pkg.Checksum { return pkg.MustDecode(s) } +// KV is a key-value pair of strings. +type KV [2]string + var ( // AbsUsrSrc is the conventional directory to place source code under. AbsUsrSrc = fhs.AbsUsr.Append("src") @@ -364,7 +367,7 @@ func (t Toolchain) NewPatchedSource( name, version string, source pkg.Artifact, passthrough bool, - patches ...[2]string, + patches ...KV, ) pkg.Artifact { if passthrough && len(patches) == 0 { return source @@ -446,7 +449,7 @@ type PackageAttr struct { ScriptEarly string // Passed to [Toolchain.NewPatchedSource]. - Patches [][2]string + Patches []KV // Kind of source artifact. SourceKind int |
