Re: [go-nuts] Mutex contention in sql.Close()

2023-12-14 Thread Joshua Garnett
. > > My guess is that when you close rows it has to wait for db acknowledgement > - that this is a false positive based on wall time and not cpu time - that > the mutex is waiting for the cleanup operation to complete. > > On Dec 13, 2023, at 1:25 PM, Joshua Garnett > wrote: &g

Re: [go-nuts] How to add zero after a decimal point in float datatype

2022-10-12 Thread 'Joshua Christudoss' via golang-nuts
Use   | %.2f     in   fmt.printf | Thanks & Regards Joshua Christudoss In Christ | For Christ | By Christ Sent from Yahoo Mail on Android On Thu, 13 Oct 2022 at 1:20 am, Jan Mercl<0xj...@gmail.com> wrote: On Wed, Oct 12, 2022 at 9:31 PM pravin chaudhary wrote: >

Re: [go-nuts] Questions about documentation of Go standard library

2021-08-26 Thread Joshua O'Connor
n't think it should affect your usage of the package :) Joshua -- 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...@googlegroup

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Joshua
Thanks a lot for the thoughts everyone, I will take all your suggestions under advisement. Jan: Thanks for the tips for performance, however with this project I'm not particularly trying to squeeze as much performance as possible, and I prefer the "safety" of the otherway. I mean safe in that,

[go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Joshua
Hello, I have 2 questions about idiomatic ways to represent optional values, and variant values in types. 1) I'm modelling a data type which has a field which may or may not be there, would most Gophers reach for a pointer here, and use `nil' to represent a missing value? 2) Another field

[go-nuts] Re: Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Joshua
that everything on golang.org would be talking about the behaviour as the specification describes it, rather than as a particular compiler implements it. On Sunday, June 6, 2021 at 6:18:38 PM UTC+1 Gregg Townsend wrote: > On Saturday, June 5, 2021 at 2:15:27 PM UTC-7 Joshua wrote: > >> H

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Joshua
ay still have a misapprehension. > > Try the first half of this article I know I wrote: > https://blog.golang.org/laws-of-reflection. > > I recently translated a substantial C library into Go, and watching all > the pointers disappear, at least syntactically (there were still slices),

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Joshua
your code is very slow if you don't use a pointer (that would be "a very >> good reason to care"), you shouldn't optimize it. And if you notice, you >> should open a bug against that package :) Though as established, you won't. >> >> On Sat, Jun 5, 2

[go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-05 Thread Joshua
Hello, My question is general, but for ease of communicating I'll use the specific example I ran into. I'm very new and for my first project I'm working with the bleve library [https://pkg.go.dev/github.com/blevesearch/bleve]. One function I need, "Open", returns an interface, "Index". I'd li

Re: [go-nuts] Re: Generics and parentheses

2020-07-16 Thread joshua harr
Just a note on your rationale for why not to use <: :> : "... requires more typing." Golang has, rather famously, never shied away from making developers type more. The reason it hasn't, as far as I understand, is that code is read far often than it is written, and so the extra verbosity is wort

[go-nuts] Local Go module

2019-04-16 Thread Joshua
Is there any way to install a package locally so that other projects can use it? In the gradle world, this is done using the "install" task. Joshua -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: DialTLS + Context with http Transport

2017-08-18 Thread Joshua Boelter
Depending on what you're trying to do, this might get you further https://github.com/golang/go/blob/46f4bfb2d17a3ccb4b3207d086a90cac3c00ea2f/src/crypto/tls/common.go#L417 https://github.com/golang/go/issues/16363 On Thursday, August 17, 2017 at 3:33:14 PM UTC-7, Gabriel Rosenhouse wrote: > > Hell

Re: [go-nuts] Understanding the output of "go get"

2017-04-22 Thread Joshua Humphries
I did indeed try that. Same result as wiping everything from my GOPATH (except the source I am immediately working on) and doing a normal "go get ...". On Saturday, 22 April 2017 12:58:43 UTC-4, David Peacock wrote: > > On Sat, Apr 22, 2017 at 7:54 AM, Joshua Humphries >

[go-nuts] Understanding the output of "go get"

2017-04-22 Thread Joshua Humphries
Hello, fellow Gophers! I have some code for which "go get -t -v" is suddenly failing for Go 1.6, complaining about a reference to the "context" package (added in 1.7). I haven't changed any of my imports, so this means a dependency has been updated to suddenly require Go 1.7. I'm trying to figu

[go-nuts] zb - an opinionated repo based tool for working with go

2016-11-29 Thread Joshua Rubin
Hi All, I've been working on a new tool to help with some of the challenges we've had working with repositories that contain multiple packages. It has turned into a useful tool that has replaced my use of the go command for many things. https://github.com/joshuarubin/zb *Benefits* - Faste

[go-nuts] Interface Pitfalls and Harnessing io.Reader

2016-10-20 Thread Joshua Rubin
I just put together some thoughts to try to help newcomers to Go start to grasp interfaces. It walks through some steps that I've seen people coming from languages like Perl go through. I'd really appreciate any any vetting, comments or critiques you could offer. https://jrub.in/golang-interfac

Re: [go-nuts] Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
On Tue, Oct 18, 2016 at 4:19 PM, Ian Lance Taylor wrote: > On Tue, Oct 18, 2016 at 3:13 PM, Joshua Liebow-Feeser > wrote: > > > > On Tue, Oct 18, 2016 at 2:53 PM, Ian Lance Taylor > wrote: > >> > >> On Tue, Oct 18, 2016 at 2:45 PM, Joshua Liebow-Feeser

Re: [go-nuts] Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
On Tue, Oct 18, 2016 at 2:53 PM, Ian Lance Taylor wrote: > On Tue, Oct 18, 2016 at 2:45 PM, Joshua Liebow-Feeser > wrote: > > > > On Tue, Oct 18, 2016 at 2:40 PM, Joshua Liebow-Feeser > > wrote: > >> > >> > >> > >> On Tue, Oct 18, 20

Re: [go-nuts] Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
On Tue, Oct 18, 2016 at 2:40 PM, Joshua Liebow-Feeser wrote: > > > On Tue, Oct 18, 2016 at 2:16 PM, Ian Lance Taylor wrote: > >> On Tue, Oct 18, 2016 at 12:30 PM, Joshua Liebow-Feeser >> wrote: >> > >> > I'm playing around with implementing a wai

Re: [go-nuts] Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
On Tue, Oct 18, 2016 at 2:16 PM, Ian Lance Taylor wrote: > On Tue, Oct 18, 2016 at 12:30 PM, Joshua Liebow-Feeser > wrote: > > > > I'm playing around with implementing a wait-free channel in the runtime > > package, and as part of this, it'd be really nice t

Re: [go-nuts] Re: Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
On Oct 18, 2016 12:42 PM, "adonovan via golang-nuts" < golang-nuts@googlegroups.com> wrote: > > On Tuesday, 18 October 2016 15:30:36 UTC-4, Joshua Liebow-Feeser wrote: >> >> are there any bits in a pointer which, when modified, won't mess with the GC? &g

[go-nuts] Is it safe to modify any part of a pointer?

2016-10-18 Thread Joshua Liebow-Feeser
Hi All, I'm playing around with implementing a wait-free channel in the runtime package, and as part of this, it'd be really nice to have double-word compare-and-swap (CAS). Barring that, however, for my purposes, it would actually be fine to have a one-word value that encodes both a pointer an

Re: [go-nuts] JPEG to RGB issues

2016-09-08 Thread Joshua Barone
Thanks Nigel. That explains what I'm seeing. On Wednesday, September 7, 2016 at 8:41:17 PM UTC-5, Nigel Tao wrote: > > JPEG is not a pixel-exact format, even in YCbCr color space. Different > Discrete Cosine Transformation implementations may produce slightly > different YCbCr and hence RGB val

Re: [go-nuts] Build constraints exclude go:binary-only-package directive?

2016-08-22 Thread Joshua Liebow-Feeser
Done: https://github.com/golang/go/issues/16841 On Monday, August 22, 2016 at 3:19:48 PM UTC-7, Ian Lance Taylor wrote: > > On Mon, Aug 22, 2016 at 2:57 PM, Joshua Liebow-Feeser > wrote: > > > > According to the documentation, the //go:binary-only-package directive >

[go-nuts] Build constraints exclude go:binary-only-package directive?

2016-08-22 Thread Joshua Liebow-Feeser
Hi All, According to the documentation , the //go:binary-only-package directive is only used when the file is "not excluded by build constraints." However, I have the following source: // +build !build_source //go:binary-only-package

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Joshua Liebow-Feeser
than the package scope > > But if you raised this point here in order to propose a language change, > I'll quietly slip into the shadows! > > > Paul > > > On 19 August 2016 at 19:38, Joshua Liebow-Feeser wrote: > >> Hi Paul, >> >> I think you mea

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Joshua Liebow-Feeser
Hey Paul, I think those are interesting ideas, but my concern about scope-local methods extends beyond just the methods of the sort.Interface interface; I was just using that as an example. The same complaint applies for any type used only within a given scope that needs to implement any interf

[go-nuts] Define method on scope-local type

2016-08-18 Thread Joshua Liebow-Feeser
Hi All, TL;DR: While you can define types inside of functions (or scopes inside of functions), those types can't have methods on them. This limits the usability of this feature. I propose that we add the ability to define methods on scope-local types. This came up while discussing the limitati

[go-nuts] Define method on scope-local type

2016-08-18 Thread Joshua Liebow-Feeser
Hi All, TL;DR: While you can define types inside of functions (or scopes inside of functions), those types can't have methods on them. This limits the usability of this feature. I propose that we add the ability to define methods on scope-local types. This came up while discussing the limitati

[go-nuts] Re: looking for the equivelant golang code in the aws s3 sdk, but have not found it yet. Anyone help here??? Thanks.

2016-07-19 Thread Joshua Boelter
Another example. - ContentType below is optional, but would be part of the signed headers if you use it - The req.HTTPRequest.Header.Set() allows you to add additional headers that will be part of the signed request https://github.com/aws/aws-sdk-go/issues/530 req, _ := s3Svc.PutObjectRequest(&

[go-nuts] Re: SDK aws S3 Download to stdout

2016-06-30 Thread Joshua Boelter
l { > fmt.Fprintln(os.Stderr, err) > os.Exit(1) > } > > io.Copy(os.Stdout, result.Body) > result.Body.Close() > > Thanks so much > > > El jueves, 30 de junio de 2016, 0:53:31 (UTC-3), Joshua Boelter escribió: >> >> I'v

[go-nuts] Re: SDK aws S3 Download to stdout

2016-06-29 Thread Joshua Boelter
I've been tinkering w/ the AWS Go SDK to get used to it ... this is one method using the GetObject API; see the full gist for a working example https://gist.github.com/jboelter/6f5bd598673eb0e606f10660495fc175 s3Svc := s3.New(awsSession) result, err := s3Svc.GetObject(&s3.GetObjectInput{ Bucke

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread Joshua Chase
Yep, that's exactly what I'm saying. https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.org/thread/ZLKQK7BOBVQVZ5B2ACQSXCOAOKLVRSTL/ https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Supposedly patent/legal reasons? On Mon, Jun 20, 2016 at 9:03 PM, Ian Lance Taylor

Re: [go-nuts] Re: importer.Default not able to find packages in $GOPATH

2016-06-17 Thread Joshua Liebow-Feeser
'go install' worked; thanks a ton! I'll also take a look at the other stuff you mentioned because I'm curious about the details. On Fri, Jun 17, 2016 at 5:15 PM, adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Friday, 17 June 2016 15:21:55 UTC-

[go-nuts] importer.Default not able to find packages in $GOPATH

2016-06-17 Thread Joshua Liebow-Feeser
Hi All, I'm trying to use the go/* packages to parse and type check Go source code. I've downloaded github.com/coreos/etcd to test this on, and I'm currently trying it out in the etcdserver subdirectory. When I run 'go build' everything works fine, but when I try to type check, none of the impo