Questions tagged [go-server]
18 questions
29
votes
4 answers
Golang dynamically creating member of struct
I know there is struct in Go, but for all I know, you have to define struct
type Circle struct{
x,y,r float64
}
I am wondering how you can declare a new variable that doesn't exist in the struct
circle := new(Circle)
circle.color = "black"

UniSound Waterloo
- 531
- 1
- 7
- 22
9
votes
1 answer
How to custom handle a file not being found when using go static file server?
So I'm using a go server to serve up a single page web application.
This works for serving all the assets on the root route. All the CSS and HTML are served up correctly.
fs := http.FileServer(http.Dir("build"))
http.Handle("/", fs)
So when the…

Jeff P Chacko
- 4,908
- 4
- 24
- 32
3
votes
0 answers
GoCD - Notification for GoAgent status changes(missing/lost contact)
I am using GoCD for the automated deployment of our application. I am facing an serious issue, that is if any agent lost contact/missing - its corresponding pipeline just hangs.
There is no notification sent about the unavailability of the agent or…

AVK
- 213
- 1
- 7
3
votes
1 answer
Is there any possible way to delete stage history in GoAgent?
I am using GoCD for package deployment and I would like to know if there are any possible ways to delete the Stage History in GoAgent.
I am asking this because the stage label was increasing to some extent while we are testing the pipelines and…

AVK
- 213
- 1
- 7
2
votes
1 answer
Go server with 2 cpus
I'm building a GRPC server in GO and I want increase its performance. I've increased my machine and put 2CPUS in order to make it better but I noticed that my server doesn't use all cpu cores and I couldn't find a way to fix it (I've run some tests…

Vivi
- 693
- 2
- 11
- 21
1
vote
1 answer
Why is my GO server not displaying my HTML files in the browser?
I am doing a GO course, and whenever I run my server code, I don't get any errors but when I try to type in "localhost:8080" in the browser, I get a message saying "localhost didn’t send any data. ERR_EMPTY_RESPONS". I have the same exact code as…

iCamrenn
- 11
- 2
1
vote
1 answer
Storing field of struct accessed via reflection
I am picking up quest parameters for my game from a CSV. The parameters include a stat tracked, e.g. "CardsDeployed", and conditions for what kind of cards are valid for this quest. The condition might be something like "Cost:4" where Cost…

Prateek Shah
- 23
- 4
1
vote
0 answers
How do I add a Subrouter to muxtrace.Router()?
I currently have a function in Go that creates a subrouter if a mountpoint is passed when creating a new server. I want to set up tracing using muxtrace.
import {
muxtrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gorilla/mux"
...
}
...
router…

QThompson
- 1,599
- 3
- 16
- 40
1
vote
1 answer
Remove trailing slash from urls - Go static server
I've set up a simple Go static file server with http.FileServer. If I have a directory structure like public > about > index.html, the server will correctly resolve /about to about > index.html, but it adds a trailing slash so the url becomes…

Luke Johnson
- 183
- 2
- 12
1
vote
0 answers
GoCD issue when I run a C# application
I am running a C# tool to test the Performance of deployed package and the tool tries to start Performance counters in the machine where the package is deployed. I am getting Exception while adding performance counters in that machine when I run the…

AVK
- 213
- 1
- 7
1
vote
2 answers
How to run a Go project on Go server?
I have no experience on GoLang.
I have a Go project and I want to run it on my local server on my ubuntu 14.04. I have installed Go server and Go agent and they are running.
hesam: ~ $ sudo /etc/init.d/go-server start
[sudo] password for hesam:…

Hesam
- 52,260
- 74
- 224
- 365
0
votes
0 answers
Why my golang net/http server is stopped after any time?
I have an LXC with AlmaLinux8.7 and go1.19.5 linux/amd64.
Also, I compile the program with the go build main.go command from this code:
package main
import (
"net/http"
"log"
)
func main() {
defer func() {
if g := recover(); g != nil…

Igor Branitsky
- 27
- 2
0
votes
0 answers
Using TimeoutHandler to stop processing the request after 1 sec on server side
I was going through this document related to timeouts and deadlines for HTTP servers in Go. It is a good doc, but I have one question on http.TimeoutHandler.
func slowHandler(w http.ResponseWriter, req *http.Request) {
time.Sleep(10 *…

ray an
- 1,132
- 3
- 17
- 42
0
votes
1 answer
Remote go-agent doesn't connect to go-server
Go-agent and go-server same version - v18.8.0. Server and agent are installed in different machines. In go-server/agents , the agent is not listed. The agent configuration file in /etc/default/go-agent is updated with hostname of go server.
Please…

nashter
- 1,181
- 1
- 15
- 33
0
votes
1 answer
Load Angular2 Bootstrap template ng2-admin on Go server : download fail
I am new to this forum and a newbie in Angular2 and Golang.
My issue is that I would like to try out a template on a Go server.
So, I created a main.go file containing this main() function :
func main() {
r := mux.NewRouter()
p :=…

jiji
- 337
- 2
- 3
- 13