Compare commits
2 Commits
8af8fe0979
...
b49e323ea4
| Author | SHA1 | Date | |
|---|---|---|---|
| b49e323ea4 | |||
| 1bacd716c7 |
@ -2,12 +2,12 @@ package num
|
|||||||
|
|
||||||
func IsPrime(n int) bool {
|
func IsPrime(n int) bool {
|
||||||
if n <= 1 {
|
if n <= 1 {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
for i := 2; i < n; i++ {
|
for i := 2; i < n; i++ {
|
||||||
if n % i == 0 {
|
if n%i == 0 {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,8 @@ package num
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
type checklist struct {
|
type checklist struct {
|
||||||
n int;
|
n int
|
||||||
ret bool;
|
ret bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNum(t *testing.T) {
|
func TestNum(t *testing.T) {
|
||||||
|
|||||||
3
ymod/go.mod
Normal file
3
ymod/go.mod
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module git.alienyuki.com/yuki/hellogomod/ymod
|
||||||
|
|
||||||
|
go 1.24.4
|
||||||
5
ymod/ylib.go
Normal file
5
ymod/ylib.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package ylib
|
||||||
|
|
||||||
|
func YHello() string {
|
||||||
|
return "Hello, yuki!"
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user