All Questions
905
questions
1
vote
1
answer
60
views
How is maxLength/minLength translated by go-gin
I have a simple schema object SerialNumber defined as:
SerialNumber:
type: object
description: |
A serial number of an entity. This is a basic string but with length ...
-2
votes
0
answers
18
views
Authentication header changing to smaller-cased(authentication) when sending POST request from golang server(rusty) [closed]
in the golang server when sending a POST request with a bearer Authorization , the request is being changed and at the url i hit from the golang it is shown as authorization. where the 'a' hash been ...
0
votes
1
answer
26
views
Accessing internal model info while using go-gin and openapi [closed]
I am using swagger/openapi to write a simple REST interface. In openapi I specify that some parameters are "required". For, example, the /api/v1/device is a REST endpoint. The Device object ...
1
vote
0
answers
36
views
How to Set Up Hot Reload for Gin Application Using Docker and Air in Dev Environment?
I'm working on a backend system using Gin and Docker, and I'm trying to set up two different environments: development and production. In the development environment, I want to use Air for hot ...
1
vote
0
answers
28
views
Go/Gin dlv debugger doesn't work with docker and vscode
I try to setup dev environment for Gin framework using docker and vscode. I can't figure why the breakpoint is visible in the debug console but seems the breakpoint has no effect. In docker I'm ...
2
votes
1
answer
21
views
gin router 404 on url patterns with :id parameter
I am getting a 404 error from a URL pattern with a quite simple parameter in it.
I am using gin-gonic with golang.
Here is my main programme. I've removed all other routing to isolate the problem.
...
0
votes
1
answer
58
views
Parsing path parameters dynamically from request url
I am working on a project using the fiber/v2 router, for a request mocking service. Now parameters passed via request body and query parameters are not an issue and handled easily. But here lies the ...
-2
votes
0
answers
30
views
Golang test cases for gin failing [closed]
Hi All I am trying to create a test cases for my gin gonic framework where I am using Gorm and ORM but I am getting errors like this:
[31m2024/07/03 08:48:19 [Recovery] 2024/07/03 - 08:48:19 panic ...
-1
votes
1
answer
44
views
Cannot use exported method that belongs to the package in Golang
I've got a package named services. This is the structure of the package:
services/
third_party/
discogs.go
discogsAPIStructs.go
artist_srv.go
auth_srv.go
record_srv.go
...
1
vote
0
answers
12
views
HTMLGlob template pattern matching with nested subdirectories
I am working on a golang project using gin and go templating.
My templates are in a structure like so:
C:.
├───components
├───display
....
I would like to add subdirectories to organise the templates,...
1
vote
1
answer
62
views
Problem with Sending Data through Channel with Gin Context
I create a timeout middleware and I keep getting a warning that says 'Headers were already written. Wanted to override status code 504 with 500' whenever it times out. I want to avoid that warning by ...
1
vote
0
answers
44
views
How i can fetch session data?
I try to fetch some session data using a svelte frontend and i get a response status 401
This is the code that i use for the cors
router.Use(cors.New(cors.Config{
AllowOrigins: []string{&...
1
vote
0
answers
40
views
err.Translate(trans) only works if translator passed via param (go-playground/validator)
I'm trying to translate the validation errors message because I don't like the default error message. When I pass the trans variable via param from controllers to a helper (to handle validation error),...
2
votes
0
answers
115
views
Unable to retrieve session value in Go Gin
Problem: The session data set during login is not persisting across subsequent requests.
Expected output: The session data set during login should be stored and is accessible persist requests.
func (...
0
votes
2
answers
72
views
How can I respond back on same gin context if response to be sent is received on some other endpoint
So, I have to handle sync call in async way.
My go microservice using gin context receives request on /req endpoint, and I have to send it to some other microservice say B, after performing ...