My little golang video player. Built on fyne.
Uses toml configuration file
Use go to initialize the project modules:
The following examples show how to set up a blank project properly.
Command:
go mod
Example:
-
To create a new application, initialize a module in an empty directory:
cd ~/Dev mkdir my-example-app cd my-example-app go mod init github.com/yourname/yourgame touch main.go
-
To create a new library, initialize a submodule inside the application directory:
cd ~/Dev/my-example-app mkdir libs cd libs go mod init github.com/yourname/yourgamelibs touch helpers.go
Use go to add project dependencies (requirements):
The following examples show how to add both public packages and local modules.
Command:
go get
Package:
github.com/pelletier/go-toml/v2
Repository:
Example:
-
Add package github.com/pelletier/go-toml/v2 to module dependencies:
go get github.com/pelletier/go-toml/v2
This is best done manually by editing the files and adding the following lines:
Example:
-
Add these two lines to the file: go.mod
replace example.com/yourname/library => ./libs
require example.com/yourname/library v0.0.0
-
Add an import line to the file: main.go
import libalias "example.com/yourname/library"
build (full):
go build -v -x -a .
build (quick):
go build -v -x .
Check binary:
echo Working directory: `pwd` (`dirs`)
echo File path: ./grow-player
echo Real path: `realpath ./grow-player`
echo File size: `du -h ./grow-player | awk '{print $1}'`
echo File signature: `file ./grow-player`
Launch:
./grow-player
Check GOPATH:
echo GOPATH: $GOPATH
Intro to modules on go - part-1:
Using Modules and Packages in Go
levelup.gitconnected.com/using-modules-and-packages-in-goYou can reach me on email:
Or catch me on youtube: