[go-nuts] Golang SQL query Errror: missing destination name Sum in *[]main.Tag

2022-07-15 Thread Harry Butler
I’m trying to feed the results from the SQL Query into the Sum field of my struct however i’m met with this error despite their being a Sum Field in the struct. The results from the query can range from 1-8 numbers depending on the date input in my REACT interface. package main import (

Re: [go-nuts] [ERROR] invalid argument when executing bufio.NewWriter.Flush()

2017-06-03 Thread Harry
Thanks Jan! You are great! On Saturday, 3 June 2017 13:00:51 UTC+2, Jan Mercl wrote: > > On Sat, Jun 3, 2017 at 12:42 PM Harry <hiro...@gmail.com > > wrote: > > > How can I handle to write something out using bufio.NewWriter? > > Just fine. The problem is you hav

[go-nuts] [ERROR] invalid argument when executing bufio.NewWriter.Flush()

2017-06-03 Thread Harry
Hi guys, How can I handle to write something out using bufio.NewWriter? My code is like below, var writer *bufio.Writer var err error file, _ := os.OpenFile(*fileName, os.O_WRONLY | os.O_APPEND, 0644) defer file.Close() writer = bufio.NewWriter(file)

[go-nuts] Puzzled by a profiling result around allocations

2017-03-20 Thread Harry B
will be allocated in heap?Any call to re.Match or fmt.Println() escapes the string?* System details ``` go version go1.8 darwin/amd64 GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/harr

Re: [go-nuts] Why result type is different on sql.Query()

2016-09-28 Thread Harry
Thanks, Konstantin. It would be nice idea, I'll try to check it! 2016年9月28日水曜日 23時00分14秒 UTC+9 Konstantin Khomoutov: > > On Wed, 28 Sep 2016 06:30:05 -0700 (PDT) > Harry <hiro...@gmail.com > wrote: > > > > In a nutshell, Scan() internally performs several nested

Re: [go-nuts] Why result type is different on sql.Query()

2016-09-28 Thread Harry
Thank you ksug, Your indication makes sense. I try to check more detail. And I'll feedback. 2016年9月28日水曜日 22時58分24秒 UTC+9 ksug: > > I don't think placeholder vs no placeholder makes a difference. Here is > an example where Scan() into the same table could return values of > different types

Re: [go-nuts] Why result type is different on sql.Query()

2016-09-28 Thread Harry
Thanks ksug. These two SQL expect same result. Field1's type on MySQL is int. When returning value as string type, that value is same to int value after asserted to int. But it's troublesome to handle two different result by placeholder added/not added. 2016年9月28日水曜日 21時23分52秒 UTC+9 ksug: >

Re: [go-nuts] Why result type is different on sql.Query()

2016-09-28 Thread Harry
I made a mistake. Second query don't include placeholder. sql := "SELECT field1, field2 FROM t_xxx" rows1, err := ms.DB.Query(sql) There is no error. I'm asking why result type was changed/ 2016年9月28日水曜日 19時30分23秒 UTC+9 ksug: > > Did you check your error after each call to Query()? > Without

[go-nuts] Why result type is different on sql.Query()

2016-09-27 Thread Harry
byte. Why, result type changed??? Thank you. Harry -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more

[go-nuts] Re: How example can be run in test?

2016-09-17 Thread Harry
I got it. In my case, there was only Example func. When adding something Testxxx func, it worked well. 2016年9月17日土曜日 6時52分30秒 UTC+9 James Bardin: > > This is fixed in master. In go1.7 the Examples and Benchmarks aren't run > if there are no Test functions. -- You received this message

Re: [go-nuts] How can I get running func name?

2016-07-13 Thread Harry
I want to keep something records as log and where it is to specify. 2016年7月13日水曜日 21時28分52秒 UTC+9 Konstantin Khomoutov: > > On Wed, 13 Jul 2016 04:48:18 -0700 (PDT) > Harry <hiro...@gmail.com > wrote: > > > func SomethingFunc() { > > fmt.Printf("func

[go-nuts] How can I get running func name?

2016-07-13 Thread Harry
Hello, everyone. As title, I'm trying the below. func SomethingFunc() { fmt.Printf("func is %s\n", funcName) /* code */ } I want to show func name when running each func. If I could get func name automatically, same code can be used. Thank you. Harry. -- You received th

[go-nuts] Re: Result is sometimes different despite using same value when encode by encoding/gob

2016-06-21 Thread Harry
Thank Dave and Jan. I understood completely. I'd consider another solution to manage that next. Thanks again. Harry. 2016年6月21日火曜日 14時58分39秒 UTC+9 Dave Cheney: > > To serialise the keys and values of a map and code would have to iterate > over it > > for k,v := range m { &g

[go-nuts] Result is sometimes different despite using same value when encode by encoding/gob

2016-06-20 Thread Harry
err = d.Decode(tData) if err != nil { return err } return nil } And then, I prepared for test targeted type are struct, map, interface{}. func TestSerializeStruct(t *testing.T) { u := User{Id: 10, Name: "harry dayo"} result, err := ToGOB64(u) if err != nil { t.Errorf("

[go-nuts] Re: How to get executed query string after execution.

2016-06-13 Thread Harry
Hi Dave, Now, I'm developping cache system of query result to redis or another key-value store. Stored data are supposed that seriarized result of query using key serialized query string exected actually. Harry 2016年6月14日火曜日 10時23分25秒 UTC+9 Dave Cheney: > > If there was a way