[go-nuts] How to pass http.ResponseWriter while writing test case in Go

2019-04-01 Thread aniruddha . dwivedi
Hi, I am writing test cases in golang for one of service used in my organisation. In one of file, I have below method -- func encodeEdgeResp(_ context.Context, w http.ResponseWriter, response interface{}) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") return json.Ne

[go-nuts] facing error "pq: unexpected Parse response 'C'" for multiple queries

2019-02-11 Thread aniruddha . dwivedi
Hi, I am working on project where I connect through PostgreSQL for CRUD operations and in back end I use golang. For transaction handling , I was using simple transaction objects for handling db operations as - *tx, err := db.Begin()* * handle

Re: [go-nuts] Unable to delete multiple records (multiple ids) on hitting endpoint

2019-01-17 Thread aniruddha . dwivedi
Thanks Ian On Thursday, January 17, 2019 at 2:29:55 PM UTC+5:30, Ian Davis wrote: > > On Thu, 17 Jan 2019, at 8:13 AM, aniruddh...@nytimes.com > wrote: > > Hi I am using NYT's Marvin framework which internally uses gorilla mux. I > am able to delete single record when I pass single id as json o

[go-nuts] Unable to delete multiple records (multiple ids) on hitting endpoint

2019-01-17 Thread aniruddha . dwivedi
Hi I am using NYT's Marvin framework which internally uses gorilla mux. I am able to delete single record when I pass single id as json object in request body using postman but I don't know how to handle array of json objects here. My code is as below:- For decoding --- func DecodeDeleteUser(

[go-nuts] `gcloud app deploy` command choosing the wrong GOPATH

2019-01-08 Thread aniruddha . dwivedi
I am Using go1.11.4 for postgres connection and strictly using GAE standard. My app.yaml is as below- runtime: go111 service: alerting-postgre-service-ad In my main.go my imports are as below- package main import ( "database/sql" "encoding/json" "fmt" "log" "net/http"//"