Questions tagged [gin]
52 questions
1
vote
0 answers
server injected logger no output
I'm trying to add a logger to my server, but for some reason it doesn't work, meaning it doesn't output to stdout.
The thing is, the logger works outside the server but not when injected. Any clue what I'm missing?
func InitializeLogger()…

Eyal Solomon
- 470
- 1
- 6
- 15
1
vote
0 answers
"read: connection reset by peer" response from my golang service troubleshooting
I am running multiple services in which communicate with each other using rest API. From time to time "connection reset by peer" is returned by a service (a few times a day, not that much). If it is relevant the services are written in go using gin…

Oliver Šmakal
- 73
- 4
1
vote
0 answers
Download all data from table from database and avoid `connection reset by peer`
Context:
I have frontend and backend application. On frontend I have react + relay(graphQL), on backend Golang + gin and lib for graphQL. I created Table component in React to show data from one of the table from DB. I implemented pagination and so…

Nju
- 579
- 1
- 8
- 18
1
vote
1 answer
cookie not saved by browser
Tried 15648070,15648070 and didn't work unfortunately :)
Hi there, first time building an API with Gin, and I'm having some issues setting a cookie on my browser
I mean, when viewing the request on dev tools I see the Set-Cookie header and the…

Eyal Solomon
- 470
- 1
- 6
- 15
1
vote
1 answer
Access to fetch at 'https://abcde.eu.ngrok.io' from origin 'https://webpage.com' has been blocked by CORS policy, React and Go
I am trying to make a Post request using frontend React to my backend in Golang like this:
const Posttobackend = async (values) => {
try {
const response = await fetch(`${API_URL}`, {
method: 'POST',
headers: {
…

LupefiascoMosdef
- 45
- 6
1
vote
1 answer
What Could Be Causing c.HTML to Not Work in GetQuizController of Gin Router?
I am new to golang. I am creating quiz application in gin framework of golang. After fetching questions from database when I try to render questions in html page using c.HTML(), c.HTML() is not working. I dont know why. In other controllers I have…

Mehta Shashwat
- 11
- 2
1
vote
1 answer
Unit testing of gin's Context.Redirect works for GET response code but fails for POST response code (golang)
I want my server to redirect a particular end point to another server. This end point can be either GETted or POSTed. The HTTP response code should be 302 in both cases. And if I use curl on this code, it does indeed show response code 302 in both…

Mark Lakata
- 19,989
- 5
- 106
- 123
1
vote
0 answers
Issue with Gorm and Gin
I am facing an issue with Gorm using Gin. On the code level, there have been no changes. However, the issue that I am facing is that when I run a query using Gorm, it gives me no records, while when I run the same query in SQL Workbench, it shows me…

Shivam Singhal
- 11
- 1
1
vote
1 answer
serve file endpoint in golang with gin
I would like to serve dynamically loaded user files (let's assume simple file storage) but I want to add some checks before sending actual file (like was the user banned). I know there is a way to serve whole directory in gin, there is also way to…

asdfgh
- 2,823
- 4
- 21
- 26
0
votes
1 answer
how can I solve this error in my env variables
In this code of golang i needed to set my .env but i got this error in the running:
Error while building:
github.com/Valgard/go-pcre: build constraints exclude all Go files in…

Mohammed Al Shemmari
- 11
- 3
0
votes
2 answers
Gin CORS not adding to response
I'm using golang gin and I got this error
I know this is a CORS error and I fixed it in NodeJS but this time I'm working with golang and hence not able to fix it.
I got around this package https://github.com/gin-contrib/cors and modified my code
r…

Sushant Dhiman
- 29
- 3
0
votes
1 answer
Docker container localhost not exposed
When starting a gin server, I was using router.Run("localhost:8080").
Afterwards, running the docker command docker run -p 8080:8080 does not expose the service to my local machine.
It only worked after I changed it to…

jellypancake
- 45
- 4
0
votes
1 answer
how to rangle golang gin into producing the environmental variables in tabbed json output?
Recently started messing about with go and gin. I am attempting to have gin output the environmental variables set in the environment. However, I'm a little confused with the error I am getting.
PS .\Desktop\go-env> go run .\vars.go
#…

Mr. E
- 457
- 1
- 5
- 20
0
votes
1 answer
Why run cancelFunc() at the end of the function
when I create a context WithCancel function by golang,why suggest to run the cancelFunc at the end of the function。
I think,assume I use gin framework, After current function run finished,the context of gin will destory。So is it necessary to run the…

李明泽
- 43
- 1
- 6
0
votes
0 answers
GINEConv for link prediction
I have a complete graph with N nodes and (N*N-1)/2 links. Total links with positive label are N-1. I use GINEConv for link prediction. I need to predict which links are part of the graph (positive label). Since the number of positive links is much…