Continued work on the test/edit post routet
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@@ -30,3 +31,20 @@ func (t *Test) SelectedBenchmarks() []string {
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
func (t *Test) IsBenchmarkSelected(benchmarkID string) bool {
|
||||
benchmarkConv, err := strconv.ParseUint(benchmarkID, 10, 0)
|
||||
if err != nil {
|
||||
fmt.Println("Error parsing Uint: ", err)
|
||||
}
|
||||
|
||||
benchmarkUint := uint(benchmarkConv)
|
||||
|
||||
for _, b := range t.Benchmarks {
|
||||
if b.ID == benchmarkUint {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user