Compare commits

..

No commits in common. "master" and "v2.0.0" have entirely different histories.

5 changed files with 11 additions and 21 deletions

10
add.go
View file

@ -1,5 +1,13 @@
// Пакет, складывающий два числа
package testmod package testmod
func Add(a, b int) int { 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 return a + b
} }

2
go.mod
View file

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

View file

@ -1,13 +0,0 @@
// Пакет, складывающий два числа
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
}

View file

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

View file

@ -1,2 +0,0 @@
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=