Re: [go-nuts] New type in generics

2024-01-13 Thread Daniel Theophanes
turn v > } > > I will say, though, that it's not unlikely that you'll be happier if you > don't do this and instead accept a plain interface value and let the caller > allocate the value and pass in a pointer. But if you want to do it, this is > the way. > > On Sat, Ja

[go-nuts] New type in generics

2024-01-13 Thread Daniel Theophanes
I have a situation where I would like to create a type, then set a property on it within a container. To set the type, I envisioned using a method "SetName" which would need to take a pointer receiver: (goplay share is down right now so I'll post inline: type Namer interface { SetName(name

[go-nuts] Re: Reading .xls file with golang

2023-02-24 Thread Daniel Theophanes
There isn't a good XLS reader. I had to fork that version here: https://pkg.go.dev/github.com/kardianos/xls It still has issues, but it is better then the previous version. On Wednesday, February 15, 2023 at 7:55:26 AM UTC-6 Amnon wrote: > File an issue at https://github.com/extrame/xls/issues

Re: [go-nuts] Generic array and slice type options

2023-01-09 Thread Daniel Theophanes
Thank you Ian. On Sun, Jan 8, 2023 at 10:40 PM Ian Lance Taylor wrote: > On Sun, Jan 8, 2023 at 1:17 PM Daniel Theophanes > wrote: > > > > When playing around with generics, I ran into what I perceive as an odd > limitation. > > > > I forked an audio packa

[go-nuts] Generic array and slice type options

2023-01-08 Thread Daniel Theophanes
When playing around with generics, I ran into what I perceive as an odd limitation. I forked an audio package "beep" to do some fun generics with it. https://github.com/kardianos/beep/blob/master/interface.go I was trying to use the following interfaces: type Point[S Size] interface { //

Re: [go-nuts] Data race in sql package

2022-07-26 Thread Daniel Theophanes
It should be safe to use RawBytes from *Conn or *Tx, the transaction won't be re-used. We will look into it further. On Friday, July 22, 2022 at 4:40:16 AM UTC-5 Michal Hruby wrote: > That's right, atm there's no safe way to use sql.RawBytes, it should > either be documented that you need to

[go-nuts] First column in sql rows.Scan is always zero

2020-06-10 Thread Daniel Theophanes
Can you try to use github.com/golang-sql/table ? That might help. -- 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. To

[go-nuts] Re: [ANN] Gio: portable immediate mode GUI programs in Go for iOS/tvOS, Android, macOS, Linux, Windows

2019-04-03 Thread Daniel Theophanes
, good to know. 1. https://bbs.deepin.org/forum.php?mod=viewthread=133029=1#pid279019 On Wednesday, April 3, 2019 at 7:51:59 AM UTC-7, ma...@eliasnaur.com wrote: > > > > On Monday, April 1, 2019 at 7:18:49 AM UTC+2, Daniel Theophanes wrote: >> >> I don't typically run

[go-nuts] Re: [ANN] Gio: portable immediate mode GUI programs in Go for iOS/tvOS, Android, macOS, Linux, Windows

2019-03-31 Thread Daniel Theophanes
I don't typically run wayland anywhere, but I was interested in this project and installed wayland and weston from my package manager. However, it seems my package manager's version of weston (v4.0.0) is too old(?) because I get the Go error: "wayland: no xdg_wm_base available". Probably from

[go-nuts] Decimal survey

2019-03-28 Thread Daniel Theophanes
Hello, If you represent decimals or money in Go, I'd like to hear from you: https://docs.google.com/forms/d/e/1FAIpQLScqXYCCCS4fTJXnRvB0qDWsbDXFL9tBBtwDY4y3Ym953nq5MQ/viewform I work on database/sql and a few sql drivers. I'm hoping to make working with decimals, especially when working with

[go-nuts] database/sql changes and proposals

2019-02-12 Thread Daniel Theophanes
In order to help keep database/sql driver developers and the maintainers of database/sql on the same page, I'm going to start to posting issues and proposals to the following group: https://groups.google.com/forum/#!forum/golang-sql If you are a driver developer, I would recommend subscribing to

Re: [go-nuts] Go offline development recommendations

2018-12-13 Thread Daniel Theophanes
Hi, Vendoring will be around a long time. Support for vendoinrg + modules is getting better with the 1.12 release even. If you need to develop offline, that is the way to go. Also, vendoring is not a footgun. You check in your vendor directory and that ensures all developers and CI tools are

[go-nuts] Re: discuss database/sql feature request: add ability to retrieve driver.Driver by registered driver name.

2018-11-01 Thread Daniel Theophanes
Driver name issue: https://golang.org/issue/12600 But I think I would prefer to solve: https://golang.org/issue/18080 Now with connectors (sql.OpenDB) drivers may not have a "name". I would love a working proposal that would take the place of ocsql, or at least provide it hooks to work without

[go-nuts] database/sql/driver: how to return *sql.Rows?

2018-09-22 Thread Daniel Theophanes
I'm sorry, I've been meaning to reply. I'll do so tonight if I can. -- 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

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-28 Thread Daniel Theophanes
Thank you for looking into this! This looks great! -- 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 options,

[go-nuts] Re: Go += Package Versioning

2018-02-27 Thread Daniel Theophanes
Hi Robert, you still can do that. Just add a "replace" directive in the local go.mod. Please see https://research.swtch.com/vgo-tour for more details. On Tuesday, February 27, 2018 at 1:47:40 PM UTC-8, Robert Carlsen wrote: > > Before with the naive GOPATH workflow and also with vendoring, it

[go-nuts] Re: Is go1.10beta1 a debug or unoptimized build? (possible regression)

2017-12-23 Thread Daniel Theophanes
It did change. See https://golang.org/cl/76990 and https://github.com/golang/go/issues/20427 . The numbers you posted look larger then anticipated if it is the same one. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Is go1.10beta1 a debug or unoptimized build? (possible regression)

2017-12-22 Thread Daniel Theophanes
The beta is a normal release, not debug or no opt. File an issue, if possible try to get a minimal repro case you can post. -- 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

Re: [go-nuts] Re: Short Term DSN for database/sql

2017-11-09 Thread Daniel Theophanes
e SQL > interface's connection pool? They go back to the driver provided Connector > interface to re-authenticate/create a connection? > > Thanks, > Anthony > > > On Thursday, November 9, 2017 at 10:49:00 AM UTC-8, Daniel Theophanes > wrote: > >> It allows driv

Re: [go-nuts] Re: Short Term DSN for database/sql

2017-11-09 Thread Daniel Theophanes
that the sql interface would use when it needed to > open a new connection correct? > > Anthony > > > On Tuesday, November 7, 2017 at 9:44:05 AM UTC-8, Daniel Theophanes wrote: >> >> Go1.10 will ship with a driver connector >> https://tip.golang.org/pkg/database

[go-nuts] Re: Short Term DSN for database/sql

2017-11-07 Thread Daniel Theophanes
Go1.10 will ship with a driver connector https://tip.golang.org/pkg/database/sql/driver/#Connector . It would be possible for a driver to provide a callback function that returned the most recent authentication parameters by using that. Thanks, -Daniel On Tuesday, November 7, 2017 at 5:34:20

[go-nuts] Go tool for formatting sql in the source code

2017-09-19 Thread Daniel Theophanes
Start by building a lexer for your SQL dialect or find an existing one. Once done investgate the go/ast package. -- 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

Re: [go-nuts] Re: [Blog] Context should go away for Go 2

2017-08-08 Thread Daniel Theophanes
I'm personally reasonably happy with Context as-is. Bit if you are looking for a better solution, I completly agree with "as.utf8": the solution won't be found in TLS/GLS (goroutine local storage) but in some other contextual/namespace/arena type thing that is larger then a single goroutine, is

[go-nuts] Re: [Blog] Context should go away for Go 2

2017-08-07 Thread Daniel Theophanes
Hello Micha, I'm not seeing any experiences (project building/maintaining) you are reporting on. In the projects I've worked on the switch to Context has been a huge win all across the board. I think it would be sweet to find an effect way to make io.Reader take a context (I often want just

[go-nuts] Re: database/sql: Latency when calling DB.QueryContext()

2017-06-29 Thread Daniel Theophanes
I don't think this has anything to do with the Context method variants or Context related code. This is just two different checks. One when the connection is returned, one periodically. You seemed to say this was introducing latency. Can you make some benchmarks with a real driver, one with

[go-nuts] Re: Completeness of Golang drivers for open-source and enterprise databases.

2017-06-10 Thread Daniel Theophanes
I didn't know of anyone working on those drivers. -- 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 options,

[go-nuts] Re: Using Context to store TraceIDs

2017-05-31 Thread Daniel Theophanes
Hi Bill, Generally if you have a Trace ID, you are also doing something that involves multiple systems, processes, or routines. If that is the case, you also need a way to cancel your resource. Thus Trace ID is included with values in the context and not separated. When Dave voiced his own

[go-nuts] Re: [database/sql] Why do DB.QueryContext and Stmt.QueryContext have different retry logic?

2017-05-19 Thread Daniel Theophanes
I think this is a bug. Please file an issue. The go1.9 freeze is already in place, but this may qualify as a bugfix that will fly under that if done quickly. Thanks, -Daniel On Friday, May 19, 2017 at 7:52:42 AM UTC-7, Krzysztof Drys wrote: > > We are getting problems with driver.ErrBadConn,

Re: [go-nuts] Re: Go MySql - out parameter

2017-04-04 Thread Daniel Theophanes
mssql driver ( https://github.com/denisenkom/go-mssqldb ) doesn't yet support output variables, though I have support planned for go1.9. You can use rdb (I currently use it in a line of business application), but I would recommend you use https://github.com/denisenkom/go-mssqldb if possible

[go-nuts] Re: sql: please, guys, tell me I am doing it wrong.

2017-04-03 Thread Daniel Theophanes
You're doing it wrong. You want: https://godoc.org/bitbucket.org/kardianos/table On Monday, April 3, 2017 at 5:51:04 AM UTC-7, JuciÊ Andrade wrote: > > I built a little command line utility for running arbitrary sql queries. > You use it like: > > runQuery "select * from myTable" > > >

[go-nuts] Re: [ANN] fsq 1.4.0 released

2017-03-11 Thread Daniel Theophanes
That's cool! I would suggest however that you also checking y.go, as is conventional in go. That way "go get" works out of box, and is one less step to install. Thanks for the tool, every once in a while I want something like this. -Daniel On Saturday, March 11, 2017 at 12:22:26 PM UTC-8,

[go-nuts] is this race condition normal?

2017-02-18 Thread Daniel Theophanes
All detected race conditions are a problem. Use a mutex. -- 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: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-12 Thread Daniel Theophanes
It is difficult to be certain, but I would put my bets on your sql anywhere driver may not be handling the c data lifetimes correctly, or might not be keeping a reference. It is difficult to tell without the driver code. Thanks, -Daniel On Saturday, February 11, 2017 at 7:27:11 PM UTC-8, Mark

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Daniel Theophanes
t;> Go is awesome i hope the eco system will grow in the future and the >>>> language can stand against rust and the omni present of c/c++. >>>> >>>> Cheers snmed >>>> >>>> >>>> >>>> Am Donnerstag, 12. Januar 2017 16:18:

Re: [go-nuts] Re: Isn't the use of Context in db/sql non-diomatic?

2016-12-11 Thread Daniel Theophanes
gt; > But this feels just as hacky, as putting those options into the context... > > Daniel Theophanes <kardia...@gmail.com> ezt írta (időpont: 2016. dec. > 11., V, 14:48): > > How would you put them in query when args are the last ...warm? > > On Sat, Dec 10, 2016, 22:44 Tamás Gul

Re: [go-nuts] Re: Isn't the use of Context in db/sql non-diomatic?

2016-12-11 Thread Daniel Theophanes
How would you put them in query when args are the last ...warm? On Sat, Dec 10, 2016, 22:44 Tamás Gulácsi wrote: > I'd also like to change the API for passing options as Andrè suggested: by > optional funcs. But everywhere - they're not to be in a Context! > > To put them

Re: [go-nuts] Re: Isn't the use of Context in db/sql non-diomatic?

2016-12-10 Thread Daniel Theophanes
André, Thanks for the constructive feedback. I agree the signature you propose would be another way to do this. For people who care about these settings, I would expect multiple queries per request is normal and ensuring the props are the same sounds like a benefit, not a detriment. In other

Re: [go-nuts] Re: Isn't the use of Context in db/sql non-diomatic?

2016-12-09 Thread Daniel Theophanes
Hi Chandra, In my view using context to store value for these uses (Read-Only and Isolation Level) is somewhat of a gray area. They are not a classical request only scope, like a tracing ID, but they also aren't strictly limited to a single request either. Say you wanted to kick off a request,

[go-nuts] How can I make io.Reader stop reading?

2016-11-16 Thread Daniel Theophanes
You can also use it.CopyContext and cancel the ctx. -- 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 options,

Re: [go-nuts] Will database/sql leak memory if I don't call Close() and remove references to it?

2016-11-01 Thread Daniel Theophanes
I think there is a larger issue at play of how old connections are cached and handled. In particular there is no way to flush cached connections or update credentials in the API. Could you file an issue with how to best update credentials on an existing connection pool? -- You received this

[go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-24 Thread Daniel Theophanes
My understanding is that the original rust font render code could replace something like FreeType. Do you envision using iconvg and vector as a replacement for the go freetype package, where font glyphs would be loaded in as iconvg byte streams in a cache and then simply read from there in the

[go-nuts] Re: Govendor and Docker Build Container issues

2016-09-20 Thread Daniel Theophanes
I would run govendor list Does it report any external packages? If so run "govendor add +external" On Tuesday, September 20, 2016 at 8:12:16 AM UTC-7, sc28 wrote: > > I have a application structure as follows in my GoPath: > > --/ myproject > | > |-- apps >|-- app1

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread Daniel Theophanes
What is the purpose of this? For instance, In govendor the hash of the files, file names, and path is computed and recorded. That way if they are modified it is detected. So yeah, md5 or blake2 would work just fine. On Wednesday, August 3, 2016 at 10:14:53 AM UTC-7, atd...@gmail.com wrote: > >

[go-nuts] Re: How do i create a fake drive that shows up in windows explorer?

2016-07-29 Thread Daniel Theophanes
If you're on windows you either want https://dokan-dev.github.io/ which shows up as a native drive or webdav https://godoc.org/golang.org/x/net/webdav which shows up as a network drive. On Thursday, July 28, 2016 at 4:31:22 PM UTC-7, Justin C wrote: > > Good afternoon, > I am trying to create

[go-nuts] Re: nodemon style tool

2016-07-25 Thread Daniel Theophanes
If you are looking for a file watch tool where you can do those things, you could look at modd: https://github.com/cortesi/modd#quick-start On Monday, July 25, 2016 at 10:36:18 AM UTC-7, KLR wrote: > > Hi, is there a nodemon style tool for go (or less bulky) or has anyone a > recommendation for