Naming environment variables

293 views
Skip to first unread message

Siddhesh Divekar

unread,
Aug 26, 2020, 11:03:21 AM8/26/20
to golang-nuts
Hi,

What is the convention to name an environment variable if the program is going to set it and use it.
I have seen both ABC_DEF & AbcDef forms of it.

--
-Siddhesh.

Ian Lance Taylor

unread,
Aug 26, 2020, 12:10:04 PM8/26/20
to Siddhesh Divekar, golang-nuts
On Wed, Aug 26, 2020 at 8:03 AM Siddhesh Divekar
<siddhesh...@gmail.com> wrote:
>
> What is the convention to name an environment variable if the program is going to set it and use it.
> I have seen both ABC_DEF & AbcDef forms of it.

Do you mean the name used for the environment variable, or the name
used in the Go program?

Most environment variables use names in all caps with underscores, so ABC_DEF.

Most Go variables use mixed caps, so AbcDef.

Ian

Siddhesh Divekar

unread,
Aug 26, 2020, 3:05:31 PM8/26/20
to Ian Lance Taylor, golang-nuts
Hi Ian,

Got it !

Thanks.
--
-Siddhesh.
Reply all
Reply to author
Forward
0 new messages