File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -88,17 +88,29 @@ func main() {
88
88
89
89
// Create employee
90
90
createId , err := CreateEmployee (conn , "Jake" , "United States" )
91
+ if err != nil {
92
+ log .Fatal ("CreateEmployee failed:" , err .Error ())
93
+ }
91
94
fmt .Printf ("Inserted ID: %d successfully.\n " , createId )
92
95
93
96
// Read employees
94
97
count , err := ReadEmployees (conn )
98
+ if err != nil {
99
+ log .Fatal ("ReadEmployees failed:" , err .Error ())
100
+ }
95
101
fmt .Printf ("Read %d rows successfully.\n " , count )
96
102
97
103
// Update from database
98
104
updateId , err := UpdateEmployee (conn , "Jake" , "Poland" )
105
+ if err != nil {
106
+ log .Fatal ("UpdateEmployee failed:" , err .Error ())
107
+ }
99
108
fmt .Printf ("Updated row with ID: %d successfully.\n " , updateId )
100
109
101
110
// Delete from database
102
111
rows , err := DeleteEmployee (conn , "Jake" )
112
+ if err != nil {
113
+ log .Fatal ("DeleteEmployee failed:" , err .Error ())
114
+ }
103
115
fmt .Printf ("Deleted %d rows successfully.\n " , rows )
104
116
}
You can’t perform that action at this time.
0 commit comments