This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
references: | |
- https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html | |
- https://stackoverflow.com/questions/32777081/bulk-insert-and-update-in-mysql | |
- https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql | |
*/ | |
/* create a new database and use it */ | |
drop database if exists test_upsert; | |
create database test_upsert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
) | |
func IsOperator(c uint8) bool { | |
return strings.ContainsAny(string(c), "+ & - & * & /") | |
} |