Files
Packer-Cn/hcl2template/types.build.from.go
T

21 lines
287 B
Go
Raw Normal View History

2019-10-14 17:02:53 +02:00
package hcl2template
import (
"strings"
)
func sourceRefFromString(in string) SourceRef {
args := strings.Split(in, ".")
if len(args) < 2 {
return NoSource
}
if len(args) > 2 {
2019-12-17 11:25:56 +01:00
// source.type.name
2019-10-14 17:02:53 +02:00
args = args[1:]
}
return SourceRef{
Type: args[0],
Name: args[1],
}
}