mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-04 20:15:23 -08:00
Add Golang test parser
This commit is contained in:
committed by
Jozef Izso
parent
d33ca7294f
commit
7745ff0ec1
20
reports/go/calculator.go
Normal file
20
reports/go/calculator.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import "errors"
|
||||
|
||||
func CalculatorSum(a, b int) int {
|
||||
return a + b
|
||||
}
|
||||
|
||||
func CalculatorDivide(a, b int) int {
|
||||
return a / b
|
||||
}
|
||||
|
||||
var ErrDivideByZero = errors.New("divide by zero")
|
||||
|
||||
func CalculatorSafeDivide(a, b int) (int, error) {
|
||||
if b == 0 {
|
||||
return 0, ErrDivideByZero
|
||||
}
|
||||
return a / b, nil
|
||||
}
|
||||
Reference in New Issue
Block a user