Compare commits

..

3 commits

Author SHA1 Message Date
87c00e654b Тест 2025-05-20 12:26:04 +05:00
7118b990e6 а так заработает? 2025-05-20 12:23:24 +05:00
2dee2f05e1 v1 patch 2025-05-20 11:54:10 +05:00
5 changed files with 21 additions and 11 deletions

10
add.go
View file

@ -1,13 +1,5 @@
// Пакет, складывающий два числа
package testmod
import "golang.org/x/exp/constraints"
type Number interface {
constraints.Integer | constraints.Float
}
// Функция, складывающая два числа
func Add[T Number](a T, b T) T {
func Add(a, b int) int {
return a + b
}

2
go.mod
View file

@ -1,5 +1,3 @@
module git.catgirls.asia/B4D_US3R/testmod
go 1.23.1
require golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6

13
v2/add.go Normal file
View file

@ -0,0 +1,13 @@
// Пакет, складывающий два числа
package testmod
import "golang.org/x/exp/constraints"
type Number interface {
constraints.Integer | constraints.Float
}
// Функция, складывающая два числа
func Add[T Number](a T, b T) T {
return a + b
}

5
v2/go.mod Normal file
View file

@ -0,0 +1,5 @@
module git.catgirls.asia/B4D_US3R/testmod/v2
go 1.23.1
require golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6

2
v2/go.sum Normal file
View file

@ -0,0 +1,2 @@
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=