Skip to content

Instantly share code, notes, and snippets.

@mumunuu
Last active March 26, 2021 14:44
Show Gist options
  • Save mumunuu/9d4015a332bf6d4405d7d436611c89ea to your computer and use it in GitHub Desktop.
Save mumunuu/9d4015a332bf6d4405d7d436611c89ea to your computer and use it in GitHub Desktop.
ultimate go 노션에 해당하는 모든 함수들 입니다.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(abs(-5))
}
func abs(x float64) float64 {
return math.Abs(x)
}
package main
import "testing"
func TestF1(t *testing.T) {
got := abs(-5.44)
if got != 5.44 {
t.Errorf("Abs(-5) = %F; want 5", got)
}
}
func TestNotF1(t *testing.T) {
got := abs(-5.44)
if got != 5.44 {
t.Errorf("Abs(-5) = %F; want 5", got)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment