File tree 4 files changed +22
-3
lines changed
4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 25
25
- name : Run tests with coverage report output
26
26
run : make coverage
27
27
28
- - uses : k1LoW/octocov-action@v1
28
+ - uses : k1LoW/octocov-action@v1
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ 0.0.6] - 2024/05/23
9
+ ### Changed
10
+ - Error function now panics on error
11
+
12
+
8
13
## [ 0.0.5] - 2024/05/22
9
14
### Added
10
15
- MIT license
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ type RawSqlType map[string]interface{}
12
12
13
13
func Error (err error ) {
14
14
if err != nil {
15
- log .Fatal (err )
15
+ log .Panic (err )
16
16
}
17
17
}
18
18
Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ package tests
2
2
3
3
import (
4
4
"database/sql"
5
+ "errors"
5
6
"fmt"
6
7
_ "github.com/mattn/go-sqlite3"
7
8
"github.com/mysiar-org/go-sql-raw"
8
9
"github.com/stretchr/testify/assert"
9
10
"testing"
10
11
)
11
12
12
- func Test (t * testing.T ) {
13
+ func TestRows2Map (t * testing.T ) {
13
14
db := setupDb ()
14
15
rows , err := db .Query ("SELECT * FROM album ORDER BY id" )
15
16
chkError (err )
@@ -33,6 +34,19 @@ func Test(t *testing.T) {
33
34
}
34
35
}
35
36
37
+ func TestError (t * testing.T ) {
38
+
39
+ err := errors .New ("Dummy error." )
40
+ t .Run ("panics" , func (t * testing.T ) {
41
+ defer func () {
42
+ if r := recover (); r == nil {
43
+ t .Errorf ("function should panic" )
44
+ }
45
+ }()
46
+ go_sql_raw .Error (err )
47
+ })
48
+ }
49
+
36
50
func setupDb () * sql.DB {
37
51
const file string = "test.db?mode=memory"
38
52
db , err := sql .Open ("sqlite3" , file )
You can’t perform that action at this time.
0 commit comments