10 examples of 'max int64' in Go

Every line of 'max int64' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
151func maxInt64(a, b int64) int64 {
152 if a > b {
153 return a
154 }
155
156 return b
157}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

81func maxInt64(a int64, b int64) int64 {
82 if a > b {
83 return a
84 }
85 return b
86}
463func maxInt64(i1, i2 int64) int64 {
464 if i1 > i2 {
465 return i1
466 }
467 return i2
468}
1327func MaxInt64Ptr(a, b *int64) *int64 {
1328 if a == nil {
1329 return b
1330 }
1331 if b == nil {
1332 return a
1333 }
1334 if *a > *b {
1335 return a
1336 }
1337
1338 return b
1339}
198func maxInt64() string {
199 maxInt64, _ := json.Marshal(^int64(0))
200 return string(maxInt64)
201}
506func int64Max(a1 *array.Int64) float64 {
507 var max float64
508 for i, val := range a1.Int64Values() {
509 fval := float64(val)
510 if max >= fval && i != 0 {
511 continue
512 }
513 max = fval
514 }
515 return max
516}
99func MaxUInt32(a uint32, b uint32) uint32 {
100 if a > b {
101 return a
102 } else {
103 return b
104 }
105}
36func Int32Max(a, b int32) int32 {
37 if b > a {
38 return b
39 }
40 return a
41}
30func maxOfUint32(a, b uint32) uint32 {
31 if a > b {
32 return a
33 }
34 return b
35}
70func Uint32Max(fn func(a, b uint32) bool, a, b uint32) uint32 {
71 if fn(a, b) {
72 return a
73 }
74 return b
75}

Related snippets