This Code is developed in Ubuntu 20.04
- Change Directory to
mainDirectory
$ cd mainDirectory- Initialize Your terminal.
$ go mod init && go mod tidy && go mod vendor- Run this
$ go run .You would get output.txt file in GoRunInCode/mainDirectory. You would understand why this output returns by looking GoRunInCode/anotherDirectory/main.go