On Thu, Aug 22, 2019 at 7:55 AM <per9...@gmail.com> wrote:
>
> I get a bloated /tmp-dir (in just a few days I get tens of thousands of 
> folders named /tmp/go-build828718408 etc.)

That is odd in itself.  The go-buildNNNNN directories should normally
be deleted when the go command completes.  Are you routinely killing
your go commands before they complete and have a chance to remove the
temporary directory?


> so I tried to set $GOTMPDIR, but nothing ends up there. (From what I 
> understand of the documentation the purpose of GOTMPDIR is to move tmp stuff, 
> see e.g. line 1471 of https://golang.org/src/cmd/go/alldocs.go?h=GOTMPDIR, or 
> release notes of 1.10 https://golang.org/doc/go1.10).
>
> Am I using things wrong?
>
> $ go version
> go version go1.12.6 linux/amd64
>
> $ echo $GOTMPDIR
> /tmp/go-builds
>
> $ ls $GOTMPDIR
> please-end-up-here.txt
>
> $ go build/test/this/that/etc
> [...]
>
> $ ls $GOTMPDIR
> please-end-up-here.txt

Setting GOTMPDIR should work.  What shell are you using?  Did you
"export GOTMPDIR"?

Note that, as mentioned above, an ordinary go build will create a
temporary directory in GOTMPDIR and then delete it.  So it's normal to
not see anything there after the go command completes.  You can verify
the directory it uses by running "go build -work" (in which case it
will not delete the temporary directory).

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcU-U_2Rz6UB1TUijdVyRSR-BJxxQdXgGVbJz4dX2p3vaA%40mail.gmail.com.

Reply via email to