Debian Codegraph @

cty/convert/conversion_primitive.go

raw symbols SCIP
1 package convertscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/
2
3 import (
4 "stringsscip-go gomod github.com/golang/go/src go1.18 strings/"
5
6 "github.com/zclconf/go-cty/ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/"
7 )
8
9 var stringTruescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/stringTrue. = ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("true")
10 var stringFalsescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/stringFalse. = ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("false")
11
12 var primitiveConversionsSafescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe. = map[ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#]map[ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#]conversionscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/conversion#{
13 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Numberscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Number.: {
14 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.: func(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:val. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:path. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#) (ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, error) {
15 f := valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:val..AsBigFloatscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#AsBigFloat().()
16 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().(f.Textscip-go gomod github.com/golang/go/src go1.18 `math/big`/Float#Text().('f', -1)), nil
17 },
18 },
19 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Boolscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Bool.: {
20 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.: func(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:val. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:path. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#) (ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, error) {
21 if valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsSafe:val..Truescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#True().() {
22 return stringTruescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/stringTrue., nil
23 } else {
24 return stringFalsescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/stringFalse., nil
25 }
26 },
27 },
28 }
29
30 var primitiveConversionsUnsafescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe. = map[ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#]map[ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#]conversionscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/conversion#{
31 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.: {
32 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Numberscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Number.: func(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:val. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#) (ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, error) {
33 v, err := ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.ParseNumberValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ParseNumberVal().(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:val..AsStringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#AsString().())
34 if err != nil {
35 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.NilValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NilVal., pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path..NewErrorfscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#NewErrorf().("a number is required")
36 }
37 return v, nil
38 },
39 ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Boolscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Bool.: func(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:val. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path. ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#) (ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#, error) {
40 switch valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:val..AsStringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#AsString().() {
41 case "true", "1":
42 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Truescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/True., nil
43 case "false", "0":
44 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.Falsescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/False., nil
45 default:
46 switch stringsscip-go gomod github.com/golang/go/src go1.18 strings/.ToLowerscip-go gomod github.com/golang/go/src go1.18 strings/ToLower().(valscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:val..AsStringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#AsString().()) {
47 case "true":
48 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.NilValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NilVal., pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path..NewErrorfscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#NewErrorf().("a bool is required; to convert from string, use lowercase \"true\"")
49 case "false":
50 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.NilValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NilVal., pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path..NewErrorfscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#NewErrorf().("a bool is required; to convert from string, use lowercase \"false\"")
51 default:
52 return ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/.NilValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NilVal., pathscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty/convert`/primitiveConversionsUnsafe:path..NewErrorfscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Path#NewErrorf().("a bool is required")
53 }
54 }
55 },
56 },
57 }