# Go Config file in Linux

**URL:** <https://forum.golangbridge.org/t/go-config-file-in-linux/19928>\
**Category:** Getting Help\
**Created:** [July 27, 2020, 4:30am UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928 "2020-07-27T04:30:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![witenitenz](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/witenitenz/32/8176_2.png) [@witenitenz](https://forum.golangbridge.org/u/witenitenz)\
**Post date:** [July 27, 2020, 4:30am UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928/1 "2020-07-27T04:30:35Z")

</div>

Hi,  
I’m relatively new to the language although I am familiar with other languages, and have been following many of the tutorials on how to program in Go. I work on a couple of machines, and I see that a colleague of mine was demonstrating (on his Windows machine) how to change parameters in his config file (GOOS and GOARCH) so that he could cross compile for other operating systems and architectures.

At home I run purely on Ubuntu Linux, and I have VSCode installed along with the Go compiler etc. It’s all the latest version as of 27 July 2020. I have been completely unsuccessful in finding any config file for my Go installation though (either under Go itself, or under any given project that I have created using Go example/practice code. I would think the configuration file would be associated with a particular project (IE so I can be creating two independent applications, one for say Linux, and the other for Windows, without routinely swapping the compiler back and forth. Is my thinking correct? If that’s the case I would expect to see the relevant config file under my src directory, along with my Go code, but as I say, it isn’t there.

If this file doesn’t exist by default, how do I go about creating it?

Thanks for the help. Go is proving to be a very nice language indeed (I come from a C and object oriented Pascal background).

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/nobbz/32/3096_2.png) [@NobbZ](https://forum.golangbridge.org/u/NobbZ)\
**Post date:** [July 27, 2020, 7:54am UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928/2 "2020-07-27T07:54:47Z")

</div>

I’m not aware of any config file.

Just set environment variables when running go:

```auto
$ GOOS=windows GOARCH=amd64 go build

```

---

<div class="post-metadata">

**Author:** ![j-forster](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/j-forster/32/9304_2.png) [@j-forster](https://forum.golangbridge.org/u/j-forster)\
**Post date:** [July 27, 2020, 12:16pm UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928/3 "2020-07-27T12:16:43Z")

</div>

You might be looking for the “Launch Configurations” from Visual Studio Code, see [https://github.com/golang/vscode-go/blob/master/docs/debugging.md#launch-configurations](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#launch-configurations)

---

<div class="post-metadata">

**Author:** ![witenitenz](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/witenitenz/32/8176_2.png) [@witenitenz](https://forum.golangbridge.org/u/witenitenz)\
**Post date:** [September 13, 2020, 9:21am UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928/4 "2020-09-13T09:21:05Z")

</div>

Sorted, thanks. That’s ultimately what I did. I originally did find that you can (via the terminal window) edit Go environment variables, but I was still having issues with VS Code cross compiling. Worked a charm though, if I opened a terminal window and built from there, similar to your suggestion. Thanks again.

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [December 12, 2020, 9:21am UTC](https://forum.golangbridge.org/t/go-config-file-in-linux/19928/5 "2020-12-12T09:21:06Z")

</div>

Closed on December 12, 2020, 9:21am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
