Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
How to change the Go AWS SDK default download directory in Linux. Getting no space left on device error

I am trying to download the Go AWS SDK but I don't have much space in my root.
I have mounted another device (/mnt/device2/) where I have 15 GB space available.

When I run the command go get -u github.com/aws/aws-sdk-go/... I get the error

go build github.com/aws/aws-sdk-go/service/macie2: mkdir /tmp/go-build3967698646/b570/: no space left on device

I want to change the default download directory from /tmp/ to /mnt/device2/.

Is it possible to do so?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Going by the documentation here

When checking out a new package, get creates the target directory GOPATH/src/. If the GOPATH contains multiple entries, get uses the first one. For more details see: 'go help gopath'.

Further it describes each flag and none of them seem to allow you to change the download directory.

It kinda makes sense in that it removes complexity and the fact that if you're using modules primarily - changing GOPATH should be pretty seemless.

My suggestion, provided you're using go modules, would be to just change your GOPATH env variable to point to your newly mounted storage device. This will:

  1. Re-Download all your dependencies in all your golang projects when you build or go mod tidy them
  2. If you use remote tools and used this server as you dev env - you would need to run go mod tidy for each project to prevent code editors and IDEs from screaming error at you.
  3. If you choose to delete the old GOPATH directory - make sure your new GOPATH/bin is in PATH - and you would need to re-install any binaries you may have installed there.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda