Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 02 20:32
    adshield-joon opened #3487
  • Feb 02 12:01
    Coverage (master) +null%
  • Feb 02 12:00
    Coverage (master) +null%
  • Feb 02 11:59
    Coverage (master) +null%
  • Feb 02 11:59
    Coverage (master) +null%
  • Feb 02 09:57
    ZYH-B opened #3486
  • Feb 02 09:36
    thinkerou edited #3485
  • Feb 02 09:36
    thinkerou edited #3485
  • Feb 02 09:35
    thinkerou closed #3485
  • Feb 02 09:23
    armourstill commented #3485
  • Feb 02 09:01
    ZYH-B opened #3485
  • Feb 02 08:15
    dozheiny commented #3479
  • Feb 02 05:24
    mstmdev commented #3484
  • Feb 02 04:58
    codecov[bot] commented #3484
  • Feb 02 04:58
    Coverage (#3484) +0.00%
  • Feb 02 04:58
    codecov[bot] commented #3484
  • Feb 02 04:58
    Coverage (#3484) +0.00%
  • Feb 02 04:58
    codecov[bot] commented #3484
  • Feb 02 04:58
    Coverage (#3484) +0.00%
  • Feb 02 04:54
    codecov[bot] commented #3484
Andrey Rusanov
@andreyrusanov
TL;DR - I can't work binding for query parameter to check it is positive int, especially I have a problem with checking value numeric. The problem is that is simply doesn't work for me, so I strongly need advice :)
Ibraheem Ahmed
@ibraheemdev

In my application I store a map of all my templates (map[string]*template.Template) in an ApplicationEngine struct, which is my application framework instance. I am currently using the standard context.Context to pass request scoped values between my middlewares and handlers. I need a way to access that map of templates in order to render a specific template file.

I was looking at the way gin handles this, and found that gin uses a custom struct that stores a pointer to gin.Engine, which is their application framework instance. It then has a HTML() function on the context struct, which accesses the template map stored in the gin.Engine pointer. Is there any specific reason that gin uses a custom struct instead of the standard context.Context? Some people seem to think that this is a bad idea.

sadhasivam
@sadhasivam
friends is there a standard way to print server info when the server successfully started. some like banner.txt, server version etc
Jarrod Roberson
@jarrodhroberson
Is it on topic to post a link to an issue on the github issues to get some visiblity/help on it?
Lyon.Nee
@LyonNee
Hello,
I want to ask a question about getting input parameters
type GetTxListIM struct {
    Page uint64 `form:"page" default:"1"`
    Rows uint8  `form:"rows" default:"10"`
    //ContractCall=1,Transfer=2,ContractCreation=3
    Type     []uint64 `form:"type"`
}
This is the structure content of the data I want to get
//@Param GetTxListIM query transaction_dto.GetTxListIM true "GetTxListIM"
//@Success 200 {object} transaction_dto.TxListOM
//@Failure 400 ""
//@Failure 500 ""
//@Router /Transaction/GetTransactionList [get]
func (controller *TransactionController) GetTransactionList(c *gin.Context) {
    var input transaction_dto.GetTxListIM
    if err := c.ShouldBind(&input); err != nil {
        log.Errorln(err)
    }
}
This is the Get method, here to parse the data
log:
{"level":"panic","msg":"strconv.ParseUint: parsing \"1,2\": invalid syntax","time":"2020-08-28 16:58:15"}
Lyon.Nee
@LyonNee
Please help me thanks
Jarrod Roberson
@jarrodhroberson
I am trying to create a route that will let me match the rest of the path portion of the relativePath as a .Param() I have r.PUT("template/:path", template.PutTemplate) and if I call it with template/path/to/my/template.txt I want .Param("path") to return path/to/my/template.txt is this possible?
erenJag
@erenJag

Hello o/,

Is there any way to use multiple authentication middlewares for the same route ?
We use https://github.com/appleboy/gin-jwt and a custom auth middleware based on generated tokens in the database, but we're unable to set them for the same route. If someone has a solution or a workaround to be able to authenticate users from jwt token or from the generated token please.

snowdream
@snowdream
Anybody can help me with this problem. gin-contrib/sessions#123
complib2891
@complib2891
hi, gin-contrib/sessions, redis_test.go is failing, anyone know how to fix it?
Cesc
@cesc1802
what is the best practice to write middleware to handler error using gin-gonic ?
drone-ci-dev
@cchang62
hi, gin-contrib/sessions. When I use and initiate redis as my session store, how can I get my session ID? I want to append this session ID to cookie, and then I can make a double verification on each http request or do other securities. No idea if I can assign an UUID to session name, and then get the session with the UUID in other place of web application? I also use go-gin as my base, by the way.
mahdi
@thisismz
1_dYCHVggxdpot-ExNFJ-k6w.png
How to rewrite the above code in gin?!
Cesc
@cesc1802
@thisismz gin does not support Http client
mahdi
@thisismz

@thisismz gin does not support Http client

thanks alot can you suggest another packet

1 reply
Cesc
@cesc1802
@thisismz I think you can write small package support it base on net/http package
Joshua Hemmings
@jLemmings
Currently I am serving my Vue frontend with a static route: r.Use(static.Serve("/", static.LocalFile("../frontend/dist", false)))
I would like to add the frontend in the compiled binary for easier deployment. I've tried to get it done with pkger but did not have any success. Any other idea?
Sagar
@Segamegadrive
Hi
Gergely Brautigam
@Skarlso
@jLemmings You can use rice for example to achieve this. Check out -> https://github.com/gaia-pipeline/gaia/blob/master/Makefile#L21 for an example.
Or another one I really like is github.com/jessevdk/go-assets-builder
Gaia is using Vue so that should help you out a lot :)
neoisone
@neoisone
@neoisone
can anyone forward me to any channel specific to docker content trust. Notary server!
I am doing a POC and facing issues
src/github.com/go-sql-driver/mysql/driver.go undefined: driver.connector
go version
go1.15 linux/amd64
any help is appreciated
my manager is killing me 🤪🤪🤪
I found that it was possible with go version higher than 1.10 and looking at the v 1.15 it should be supported right?
th m
michaelzh
@zhongwm
Assume we have a recursive function with a os.File::Close() as defer invocation, Could it be tail-recursive?
Muhammad Ahsan Izhar
@ahsanghalib
hello, i am new to Go world I am trying to shift some code base from NodeJS but results are different. why...
check this
go-node-01.jpg
happy air
@checkping_gitlab
sorry
qilx
@qilx
Hi, please I need help. I have assets in vfsgen and using router.StaticFS(). That works well. But I would need for each request path ending with "/" (directory) return "/index.html" from vfs. Any idea please?
qilx
@qilx
I found it out. Solution is router.NoRoute() + c.DataFromReader()
romantic艾克
@1sunzichen
Iam coming
gopher
RaminCH
@RaminCH
Hi everyone!
I am very new developer and faced with such a problem while installing Gin on Ubuntu
/go/src$ go get -u github.com/gin-gonic/gin
package github.com/gin-gonic/gin: directory "/home/user/go/src/github.com/gin-gonic/gin" is not using a known version control system
Maybe someone knows the solution?
shyan
@shyan1
Have you had git installed on your machine ? @RaminCH
It's strange to have such issues.
RaminCH
@RaminCH
Hi
Hi @shyan1
Yup, Go_lev.2_RestAPI/Lec13$ git --version
git version 2.17.1
I even deleted and reinstalled
Also I installed Gin with: sudo apt-get install -y golang-github-gin-gonic-gin-dev