go.temporal.io/server/common/convert/convert.go

79 LOC · 40 covered · 39 uncovered · 13 ranges · 1703 concepts · 11 introducers · 748 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package convert
2
3 import (
4 "math"
5 "strconv"
6 )
7
8 // Int32Ceil return the int32 ceil of a float64
9 > func Int32Ceil(v float64) int32 { convert.go ×1
10 > return int32(math.Ceil(v))
11 > }
12
13 // Int64Ceil return the int64 ceil of a float64
14 > func Int64Ceil(v float64) int64 { convert.go ×1
15 > return int64(math.Ceil(v))
16 > }
17
18 > func IntToString(v int) string { convert.go ×1
19 > return Int64ToString(int64(v))
20 > }
21
22 func Uint64ToString(v uint64) string {
23 return strconv.FormatUint(v, 10)
24 }
25
26 > func Int64ToString(v int64) string { convert.go ×1
27 > return strconv.FormatInt(v, 10)
28 > }
29
30 > func Int32ToString(v int32) string { convert.go ×1
31 > return Int64ToString(int64(v))
32 > }
33
34 > func Uint16ToString(v uint16) string { monitor.go ×40
35 > return strconv.FormatUint(uint64(v), 10)
36 > }
37
38 func Int64SetToSlice(
39 inputs map[int64]struct{},
40 > ) []int64 { convert.go ×1
41 > outputs := make([]int64, len(inputs))
42 > i := 0
43 > for item := range inputs {
44 > outputs[i] = item
45 > i++
46 > }
47 > return outputs
48 }
49
50 func Int64SliceToSet(
51 inputs []int64,
52 ) map[int64]struct{} {
53 outputs := make(map[int64]struct{}, len(inputs))
54 for _, item := range inputs {
55 outputs[item] = struct{}{}
56 }
57 return outputs
58 }
59
60 func StringSetToSlice(
61 inputs map[string]struct{},
62 > ) []string { convert.go ×2
63 > outputs := make([]string, len(inputs))
64 > i := 0
65 > for item := range inputs {
66 > outputs[i] = item convert.go ×1
67 > i++
68 > }
69 > return outputs convert.go ×2
70 }
71 func StringSliceToSet(
72 inputs []string,
73 > ) map[string]struct{} { convert.go ×2
74 > outputs := make(map[string]struct{}, len(inputs))
75 > for _, item := range inputs {
76 > outputs[item] = struct{}{} convert.go ×1
77 > }
78 > return outputs convert.go ×2
79 }