31 lines
693 B
Go
31 lines
693 B
Go
package dummy
|
|
|
|
import "math"
|
|
|
|
// Struct3185 is a dummy structure to consume memory during compilation
|
|
type Struct3185 struct {
|
|
FieldA int
|
|
FieldB string
|
|
FieldC float64
|
|
FieldD []int
|
|
FieldE map[string]string
|
|
}
|
|
|
|
// Function3185 performs arbitrary calculations to consume CPU during compilation
|
|
func Function3185(input int) float64 {
|
|
s := Struct3185{
|
|
FieldA: input,
|
|
FieldB: "dummy string to take up space in the binary symbol table",
|
|
FieldC: float64(input) * 1.5,
|
|
FieldD: []int{1, 2, 3, 4, 5},
|
|
FieldE: map[string]string{"key": "value"},
|
|
}
|
|
|
|
// Some math operations
|
|
res := math.Sqrt(s.FieldC) + float64(s.FieldA)
|
|
for _, v := range s.FieldD {
|
|
res += float64(v)
|
|
}
|
|
return res
|
|
}
|