Slightly cleaner error reporting.
Some checks failed
Fibonacci container test / Containerize (push) Failing after 30s
Fibonacci unit tests / Run-unit-tests (push) Successful in 44s

This commit is contained in:
2025-08-25 13:16:43 +02:00
parent e5aced29a3
commit 0187d4031c
3 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
name: Fibonacci unit tests
run-name: ${{ gitea.actor }} is testing Fibonacci
name: Fibonacci container test
run-name: ${{ gitea.actor }} is testing Fibonacci containerization
on:
push:
branches:

1
code/.gitignore vendored
View File

@@ -11,6 +11,7 @@
# But not these files...
!/.gitignore
!functions/*.go
!*.go
!go.sum
!go.mod

View File

@@ -1,7 +1,6 @@
package functions
import(
"errors"
import (
"fmt"
)
@@ -11,7 +10,7 @@ func MyFibonacci(count int) (fibonaccivalue int, error error) {
var prev_fibonacci int = 0
if count < 1 {
return -1, errors.New(fmt.Sprintf("%d is not a positive integer.",count))
return -1, fmt.Errorf("%d is not a positive integer", count)
}
for i := 1; i < count; i++ {
fibonaccivalue += prev_fibonacci