sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
This file contains hidden or 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
| func TestCreate(t *testing.T) { | |
| var db *sql.DB | |
| db, mock, err := sqlmock.New() // mock sql.DB | |
| if err != nil { | |
| t.Error(err) | |
| return | |
| } | |
| gdb, err := gorm.Open(postgres.New(postgres.Config{Conn: db}), &gorm.Config{}) // open gorm db |
This file contains hidden or 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
| apt-get update \ | |
| && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | |
| # | |
| # Verify git, process tools, lsb-release (useful for CLI installs) installed | |
| && apt-get -y install git procps lsb-release \ | |
| # | |
| # Install C++ tools | |
| && apt-get -y install build-essential cmake cppcheck valgrind \ | |
| # | |
| # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. |