mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-04 05:27:55 +01:00
Add Golang test parser
This commit is contained in:
parent
d33ca7294f
commit
7745ff0ec1
10 changed files with 451 additions and 0 deletions
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue