1
0
mirror of https://github.com/MADTeacher/go_basics.git synced 2025-11-23 21:34:47 +02:00
Files
go_basics/part_3/3.10/4.go

15 lines
200 B
Go
Raw Normal View History

package main
import "fmt"
type MyInt int
func Sum[T ~int | float64 | string](a, b T) T {
return a + b
}
func main() {
var value1, value2 MyInt = 34, 22
fmt.Println(Sum(value1, value2)) // 56
}