Set the "GOPATH" to "%HOMEDRIVE%%HOMEPATH%\Documents\go" or anywhere else for your main go directory, something like this:

Click "OK" on all dialog, next, just open a "Command Prompt" window and create required directory, type

go version:: go version go1.5 windows/amd64mkdir Documents\go\src:: creating a directory, only required for the first timecd Documents\go\src:: change directory to %GOPATH%\srcnotepad hello.go:: edit a new source code

2015-08-14

If you are software developer, sometimes you need to test your program faster. Normally the bottleneck of your program are in the database (writing to disk). You can increase the performance of your development/testing, by moving the database to the RAM if you have enough free RAM (>3GB). In this article, I will guide you to move your PostgreSQL database to RAM. First of all, you'll need to stop and disable the PostgreSQL, so the port won't conflict:

sudo systemctl stop postgresqlsudo systemctl disable postgresql

As we already know, /tmp folder on Linux mostly use tmpfs, that is a RAM file system. So if we create the database on the /tmp directory, it's on the RAM. What you'll need to do is create a script containing something like this:

This script will erase all your database and create a new empty database on the RAM, that you can restore into later. This script will also create a log file that shows all queries that could help on the softwade development process. Lastly, to measure your PostgreSQL's data directory size in MB you can type this command:

$ sudo du -s -B 1M /tmp/data/336 /tmp/data/

That's it, as a measurement, to restore a 137 MB database (about 300k records) in my PC normally it took about 17 seconds, when the database moved to RAM, it only took 5 seconds, so yes, it's a huge improvement.