Skip to main content

Questions tagged [go-gin]

Gin is a HTTP web framework written in Go.

2 votes
0 answers
38 views

GORM adding "AND column.id = 1", why?

Im having an issue with GORM on my GIN project. Please help me if possible. My issue is: var class models.Classrom var old_class models.Classrom old_class.ClassID = "algorithm" DB.Model(&...
Law's user avatar
  • 21
1 vote
1 answer
32 views

Go/Gin/sqlc REST API endpoint that can update data to empty string

I am trying to understand marshalling of JSON in Go. I am a little bit confused because of Go's string nil value being "", which has a different semantic than a NULL. While my code currently ...
Jonathan Lightbringer's user avatar
1 vote
1 answer
66 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 ...
Kay Dee's user avatar
  • 11
1 vote
0 answers
46 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 ...
Samy's user avatar
  • 11
1 vote
0 answers
33 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 ...
tstr's user avatar
  • 1,286
2 votes
1 answer
23 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. ...
ancient geek's user avatar
-1 votes
0 answers
19 views

openapi-cli generator with openapi spec and gin code - enforcing required parameters and validation

I was looking at the pet store example in openapi-cli . The openapi/swagger spec has the "required" attribute for many fields, which implies that the parameter must be present in the request ...
Kay Dee's user avatar
  • 11
0 votes
1 answer
63 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 ...
Aryan Gupta's user avatar
-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 ...
MrCujo's user avatar
  • 1,253
1 vote
0 answers
13 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,...
ancient geek's user avatar
0 votes
0 answers
31 views

GORM many2many Association Replace not working as expected

I have a GO application using GIN and GORM. I want to create a Roles + Capabilities database. A role can have multiple capabilities and a capability can be in multiple roles. I created the following ...
Bilal Javed's user avatar
1 vote
1 answer
64 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 ...
kartikasw's user avatar
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{&...
Ciprian's user avatar
  • 11
1 vote
0 answers
42 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),...
Andi Fasaya Yaqhsya Ma'ruf's user avatar
2 votes
0 answers
117 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 (...
Diwash Mainali's user avatar

15 30 50 per page
1
2 3 4 5
61