Questions tagged [go]

Use this tag if a question is about the programming language Go

14 questions
24
votes
1 answer

How do I use docker command's "--format" option?

I can't seem to find any good documentation on how to use the docker command's "--format" option in real life. I know how to use Go templates. But specific to docker, how do I know what placeholders are available to use? I tried docker inspect on a…
Todd Walton
  • 434
  • 1
  • 4
  • 13
4
votes
1 answer

What Golang function could be used to enforce a minimum code coverage and return an Exit1 if false?

Follow-up to this Q&A. How to ensure that a certain minimal code coverage is reached in Golang? E.g. if the CI runs, the build should fail if the code coverage is less than X percent. In Java, one could use Jacoco and define a minimum code coverage.…
030
  • 13,383
  • 17
  • 76
  • 178
2
votes
2 answers

Amazon S3 bucket does not redirect folder URLs to index.html

I have uploaded my HUGO static site into AWS S3 Bucket. I have also added the domain in cloudrfront. The home index.html page works fine, but I cannot access my resources. For example https://www.example.com works fine, but I cannot access…
workaround
  • 131
  • 1
  • 5
2
votes
1 answer

Failed to start windows service with Start Parameter in golang

I've tried to create a executable as a windows service using golang based on example provided in https://github.com/golang/sys/tree/master/windows/svc/example I intended to create auto start service with executable specific command line argument…
1
vote
1 answer

Auto update golang version that is defined in a go.mod file using Dependabot

Dependabot has been enabled and is creating PRs, but not for the Golang version that is defined in the go.mod file.
030
  • 13,383
  • 17
  • 76
  • 178
1
vote
1 answer

golang and circle CI setup

Go and devops are both new things for me. I'd like to setup a CI that tests and builds my module, then stores artifacts for download. In addition it'd be good to cache dependencies for next builds. I don't get how to do it using subdirectory for the…
LukeN
  • 11
  • 2
1
vote
1 answer

Reuse Alertmanger Slack Integration into Jiralert template

What kind of changes need to be made to a slack template in order to reuse into Jiralert one? Can I utilize the whole body as it is, can somebody post an example of a working resuse, even for the default example in vendor site.
0
votes
0 answers

Go mod download throws x509: certificate signed by unknown authority

I have got some experience in golang development on ubuntu desktop machines; however I have started with AWS ec2 instance, where I intend to do golang development. I am having an ubuntu 24.04 ec2 instance on AWS. In this I intend to do golang…
0
votes
1 answer

Why do some things stringify to their values and others strinigify to a textual representation of the data structure?

This is a follow up to this question. I figured out a solution, but this would have been MUCH easier to debug if the language didn't violate my expectation. So now I'm wondering why it did. Give this setup command $ podman run -d -p 1234:1234…
Evan Carroll
  • 2,921
  • 6
  • 37
  • 85
0
votes
1 answer

Go format string produces curly brackets around text value?

You can set up the test container to inspect with this, $ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360 When I run the following I get { 1234} however I want 1234 (no curly brackets, no spaces). How can I get this with podman/go? $…
Evan Carroll
  • 2,921
  • 6
  • 37
  • 85
0
votes
1 answer

Go format string has numbers and special characters in map index?

When I run podman inspect I can get to a map[...] with --format. But indexing through it seems to be impossible. $ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360 $ podman inspect evanrox --format '{{ .NetworkSettings.Ports…
Evan Carroll
  • 2,921
  • 6
  • 37
  • 85
0
votes
1 answer

ipfs-update isn't showing the expected version list

I ran go get -u github.com/ipfs/ipfs-update and got in the end of what it looks like an installation going on the following go get: installing executables with 'go get' in module mode is deprecated. Use 'go install pkg@version' instead. For more…
Tiago Peres
  • 121
  • 9
0
votes
1 answer

Error: error loading plugins: loading plugin /data/ipfs/plugins/go-ds-s3.so: not built with cgo support

After cloning this repo run make build (getting as output s3plugin.so) run make install make the appropriate changes in both /data/ipfs/config "Datastore": { "BloomFilterSize": 0, "GCPeriod": "1h", "HashOnRead": false, "Spec": { …
Tiago Peres
  • 121
  • 9
0
votes
0 answers

Is it possible to control Packer from golang?

We use Terraform quite a bit and it has some nice tooling like Terratest where you can essentially call Terraform from within Golang wrapped inside an API with proper error handling. I wonder if something similar exist for Packer? To clarify what I…