This is just a few proof of concept demos of programming psychological experiments using Go.
github.com/veandco/go-sdl2
will be downloaded during the first compilation.
The library SDL2 must be installed.
-
Under Linux Debian-like:
sudo apt install libsdl2-*
-
Under MacOS:
brew install sdl2{,_image,_mixer,_ttf,_gfx} pkg-config
Each subfolder is independent.
For example, to compile the streaming code:
cd streaming
go build streaming.go
./streaming
Following the instuctions at https://www.e-tinkers.com/2019/06/better-way-to-install-golang-go-on-raspberry-pi/,
save the following script in ~/bin/go_installer.sh
export GOLANG="$(curl -s https://go.dev/dl/ | awk -F[\>\<] '/linux-armv6l/ && !/beta/ {print $5;exit}')"
wget https://golang.org/dl/$GOLANG
sudo tar -C /usr/local -xzf $GOLANG
rm $GOLANG
unset GOLANG
and run it:
chmod +x ~/bin/go_installer.sh
~/bin/go_installer.sh
echo "PATH=$PATH:/usr/local/go/bin" >>~/.profile
echo "GOPATH=$HOME/golang" >>~/.profile
source ~/.profile