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 name: Fibonacci container test
run-name: ${{ gitea.actor }} is testing Fibonacci run-name: ${{ gitea.actor }} is testing Fibonacci containerization
on: on:
push: push:
branches: branches:

1
code/.gitignore vendored
View File

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

View File

@@ -1,7 +1,6 @@
package functions package functions
import ( import (
"errors"
"fmt" "fmt"
) )
@@ -11,7 +10,7 @@ func MyFibonacci(count int) (fibonaccivalue int, error error) {
var prev_fibonacci int = 0 var prev_fibonacci int = 0
if count < 1 { 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++ { for i := 1; i < count; i++ {
fibonaccivalue += prev_fibonacci fibonaccivalue += prev_fibonacci