internal/rosa: key-value type
All checks were successful
Test / Create distribution (push) Successful in 1m34s
Test / Sandbox (push) Successful in 4m52s
Test / Hakurei (push) Successful in 5m53s
Test / ShareFS (push) Successful in 5m56s
Test / Sandbox (race detector) (push) Successful in 6m52s
Test / Hakurei (race detector) (push) Successful in 8m8s
Test / Flake checks (push) Successful in 1m29s
All checks were successful
Test / Create distribution (push) Successful in 1m34s
Test / Sandbox (push) Successful in 4m52s
Test / Hakurei (push) Successful in 5m53s
Test / ShareFS (push) Successful in 5m56s
Test / Sandbox (race detector) (push) Successful in 6m52s
Test / Hakurei (race detector) (push) Successful in 8m8s
Test / Flake checks (push) Successful in 1m29s
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>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user