Re: [go-nuts] Congrats to the Go team

2024-04-27 Thread Steven Hartland
t;> 1.000 ± 0%~ (p=1.000 n=6) ¹ >>> MulFixed-8 0.000 ± 0% 0.000 ± 0%~ (p=1.000 n=6) ¹ >>> 0.000 ± 0%~ (p=1.000 n=6) ¹ >>> MulDecimal-82.000 ± 0% 2.000 ± 0%~ (p=1.000 n=6) ¹ >>> 2.000 ± 0%~ (p=1

Re: [go-nuts] Congrats to the Go team

2024-04-25 Thread Steven Hartland
(p=1.000 n=1) ² > StringDecimal-8 4.000 ± ∞ ¹ 4.000 ± ∞ ¹ ~ > (p=1.000 n=1) ² > StringBigInt-8 1.000 ± ∞ ¹ 1.000 ± ∞ ¹ ~ > (p=1.000 n=1) ² > StringBigFloat-87.000 ± ∞ ¹ 7.000 ± ∞ ¹ ~ > (p=1.000 n=1)

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread Steven Hartland
What’s it look like when your run it through https://pkg.go.dev/golang.org/x/perf/cmd/benchstat which will provide a nice side by side comparison? On Wed, 24 Apr 2024 at 19:26, 'Robert Engels' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I have a fairly stable project

Re: [go-nuts] Re: <-ctx.Done() panic - link injecting bot?

2024-03-30 Thread Steven Hartland
"Spam". Whether anyone reads these is doubtful though. > > The first spam was on 3 Jan 2024 and I reported it straight away; it > hasn't stopped the new ones coming through. > > On Saturday 30 March 2024 at 10:21:18 UTC Steven Hartland wrote: > >> Johans acc

Re: [go-nuts] Re: <-ctx.Done() panic - link injecting bot?

2024-03-30 Thread Steven Hartland
Johans account looks like a bot designed to inject links, possibly malicious, is there an admin who can investigate and take the appropriate action? On Fri, 29 Mar 2024 at 12:11, Johan Liebert wrote: -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Data structure code review

2024-03-03 Thread Steven Hartland
Some feedback: Instead of errors.New(emptyDataStructureMessage("stack")) use an emptyDataError type, where it implements the error interface by adding an Error() string method, for example: type emptyDataError string func (e emptyDataError) Error() string { return fmt.Sprintf("not empty %s

Re: [go-nuts] help

2024-02-18 Thread Steven Hartland
What’s your DATABASE_URL? If your on Windows make sure you use localhost not 127.0.0.1 as they aren’t necessarily the same thing On Sun, 18 Feb 2024 at 04:54, Sunday Ajayi wrote: > Hi guys, > Please I am having a little issue with my go project using docker. > > I set up my Postgres db in

Re: [go-nuts] Re: help with thread limit

2024-02-01 Thread Steven Hartland
Ignore that as it just triggers a panic if the limit is exceeded, however based on that I'm guessing it's not going to be possible. On Thu, 1 Feb 2024 at 19:01, Steven Hartland wrote: > Sounds sensible to me. > > I haven't read the entire thread, pun intended ;-), so just checking

Re: [go-nuts] Re: help with thread limit

2024-02-01 Thread Steven Hartland
. > > Thanks, > Steve > > On Thu, Feb 1, 2024 at 8:34 AM Steven Hartland > wrote: > >> To be honest I would question if its a usable solution if they are >> limiting that low on threads, so is the fix to switch or have the provider >> increase the limit to a sensible

Re: [go-nuts] Re: help with thread limit

2024-02-01 Thread Steven Hartland
To be honest I would question if its a usable solution if they are limiting that low on threads, so is the fix to switch or have the provider increase the limit to a sensible number? On Thu, 1 Feb 2024 at 16:08, Steve Roth wrote: > Thanks to the people who suggested how to limit the number of

Re: [go-nuts] Disable false positive go vet check in tests per line?

2024-01-28 Thread Steven Hartland
Thanks Kurtis, that's a good workaround :) On Sun, 28 Jan 2024 at 21:24, Kurtis Rader wrote: > What happens if you just alias the var? > > argsCopy := args > fmt.Printf("%v\n", argsCopy) > > > On Sun, Jan 28, 2024 at 12:13 PM Steven Hartland < > steven

[go-nuts] Disable false positive go vet check in tests per line?

2024-01-28 Thread Steven Hartland
When running a test I'm getting: missing ... in args forwarded to print-like function Usually this would be helpful as the pass in variadic should generally be expanded with ... but in this case I specifically want the result of args passed as a slice. Is there a way to disable go vet checks for

Re: [go-nuts] Re: Good examples of Go back ends?

2024-01-23 Thread Steven Hartland
It's high level, but there's some good stuff mentioned in https://github.com/avelino/awesome-go On Mon, 22 Jan 2024 at 15:23, george looshch wrote: > hi Jason, > > thanks a million for pointing out the vagueness of my question! English > isn’t my mother tongue so now i see where you’re coming

Re: [go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-21 Thread Steven Hartland
poll and select for this behavior was broken in FreeBSD up until 195423 was committed as detailed by this bug report . Given the MacOS and FreeBSD have related history I wouldn't be surprised

Re: [go-nuts] CPU usage increasing day by day because of Cron

2023-07-06 Thread Steven Hartland
Your use of sync.WaitGroup looks strange. Typically you would expect to call wg.Add(1) before a goroutine is started, wg.Done() before it returns and wg.Wait() to ensure all goroutines have completed. This doesn't seem to be what you're doing. Consider restructuring to make best use of the

Re: [go-nuts] slog - potentially broken test

2023-07-03 Thread Steven Hartland
Looks like a bug, I suspect because you have a space in the path the path was quoted breaking the regexp as it's not expecting the final quote. Try editing the regexp to: ^time=\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}(Z|[+-]\d{2}:\d{2}) level=INFO source=.*logger_test.go:\d{3}"? msg=msg2$ On

[go-nuts] pkg.go.dev down?

2023-03-08 Thread Steven Hartland
Is there an issue with pkg.go.dev atm as packages are failing to load after a long time with a 500 error for example time -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-06 Thread Steven Hartland
I would use the following if I truly wanted to ignore an error, but I would question if ignoring the error from os.Open was ever a good idea. If you want to handle a file not found error then do so, don't just ignore the error. file, _ := os.Open(name) //nolint: errcheck On Mon, 6 Mar 2023 at

Re: [go-nuts] go install of forked repo

2022-12-03 Thread Steven Hartland
Check out go work I achieve it’s exactly what you are looking for, allowing for projects to use temporary local versions of packages On Sat, 3 Dec 2022 at 11:55, Duncan Harris wrote: > This seems a noddy question but can't easily find an answer with Google > apparently. I may have lost the plot

Re: [go-nuts] imported and not used "errors"

2022-09-27 Thread Steven Hartland
Something is already running on localhost port 8080. use a different port. On Tue, 27 Sept 2022 at 16:15, Conor O'Neill wrote: > I am following a tutorial to great an API in Go with a framework called > Gin. > > I have imported errors and created a function like so; > > func createBook(c

Re: [go-nuts] How to check Cmd.ProcessState without triggering the race checker?

2022-07-25 Thread Steven Hartland
Looks like session already has what you need as you can check if session.Exited has been closed something like: select { case <- session.Exited: // Handle session has ended default: // Handle session hasn't ended } On Sat, 23 Jul 2022 at 21:39, TheDiveO wrote: > In my open source

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

2022-07-21 Thread Steven Hartland
I'm guessing that Michal is flagging is there no way to write safe code if your using stmt.QueryContext(ctx) and rows.Scan into a sql.RawBytes as QueryContext kicks off a go routine that monitors the ctx, closing rows if cancelled and that ctx can be cancelled at any time. The only thing that

Re: [go-nuts] how to minimize the size of struct?

2022-07-14 Thread Steven Hartland
https://pkg.go.dev/reflect#Type.Size or https://pkg.go.dev/unsafe#Sizeof On Wed, 13 Jul 2022 at 08:00, xie cui wrote: > > https://github.com/orijtech/structslop/blob/13637e228c1a50d8444da1b71a83aff3b6536851/structslop.go#L246-L267 > why sort by can minimize the sizeof > struct? > is there some

Re: [go-nuts] Re: No downloadable go1.18.1 version for darwin

2022-04-14 Thread Steven Hartland
Looks like this is fixed now. On Wed, 13 Apr 2022 at 15:48, Brian Candler wrote: > It's mentioned in the original announcement > : > > "macOS binary artifacts for Go 1.18.1 are not available at this time due > to an issue

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-12 Thread Steven Hartland
First off, the package you're using for redis isn't maintained; you should switch to github.com/gomodule/redigo/redis instead, which will allow you to remove the c == nil check as that doesn't happen. In your example you're ignoring error from json.Marshal which could be hiding a problem, so I

Re: [go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread Steven Hartland
aw this pattern before. Thanks for > your help !! > If you have any reference material for further reading for patterns like > this can you please share them. > > Regards, > Gowtham > > On Mon, 28 Mar 2022 at 12:21, Steven Hartland > wrote: > >> There is no guarantee

Re: [go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread Steven Hartland
There is no guarantee that the select chooses the done case, so you need to check in work case as well e.g. https://go.dev/play/p/zAj_qfO4uMA On Mon, 28 Mar 2022 at 16:54, Gowtham Raj wrote: > In this example, we have a *worker*. The idea here is simulate clean > shutdown of all go routines

Re: [go-nuts] Re: Advise about using go mod retract to fix pre go mod v2.0.0 tag

2022-01-04 Thread Steven Hartland
no "/v2" suffix, for compatibility with old code). > > Therefore, the Go toolchain will go look at whatever is latest for " > github.com/gomodule/redigo", then use the retractions there. It won't > look for "github.com/gomodule/redigo/v2". > On Friday,

Re: [go-nuts] Re: Advise about using go mod retract to fix pre go mod v2.0.0 tag

2021-12-31 Thread Steven Hartland
gt; that would be in the v1 series (no v# in the URL, so must be v0 or v1). > > On Friday, December 3, 2021 at 6:53:04 AM UTC-8 Steven Hartland wrote: > >> One of the golang packages I maintain redigo had a v2.0.0 tag created >> before the introduction of go mod and this stil

[go-nuts] Advise about using go mod retract to fix pre go mod v2.0.0 tag

2021-12-03 Thread Steven Hartland
One of the golang packages I maintain redigo had a v2.0.0 tag created before the introduction of go mod and this still causes challenges today. A kind soul pointed out go mod retract the other day in the

Re: [go-nuts] Re: pkg.go.dev jump to broken?

2021-11-17 Thread Steven Hartland
Didn't touch anything on my side and it's working again today, error has gone from the console as well, so can only assume someone fixed something. Thanks for feedback Brian :) Regards Steve On Tue, 16 Nov 2021 at 20:44, Brian Candler wrote: > Works for me: Chrome 96.0.4664.45, macOS

[go-nuts] pkg.go.dev jump to broken?

2021-11-16 Thread Steven Hartland
Clicking the jump to or pressing F on pkg.go.dev seems to be broken here. In Chrome console I'm seeing security warning about eval, which could be the cause: Content Security Policy of your site blocks the use of 'eval' in JavaScript` The Content Security Policy (CSP) prevents the evaluation of

[go-nuts] Re: Help getting database/sql pooling merged

2021-10-29 Thread Steven Hartland
Just a quick bump to see if we can get this over the line in time for the 1.18 release freeze in just a couple of days time? On Sat, 23 Oct 2021 at 00:29, Steven Hartland wrote: > There's been a long standing bug > <https://github.com/golang/go/issues/39471> in database/sql p

[go-nuts] Help getting database/sql pooling merged

2021-10-22 Thread Steven Hartland
There's been a long standing bug in database/sql pooling which means SetConnMaxIdleTime doesn't work. I found and fixed the bug back in June of 2020, but have so far been unable to get this relatively

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-18 Thread Steven Hartland
and doing the same thing... > I'm sure you can see how this can take some time -- especially for large > projects. > > Anyway, it sounds to me like what you're asking to do requires the use of > the type-checker and because of the dependency management involved I > believe the most

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-17 Thread Steven Hartland
: > I am not sure what "import external packages" means. > > Apart dot imports (which I have never seen used for real) why would you > need to load the imported packages? > > On Saturday, 16 October 2021 at 20:34:17 UTC+1 Steven Hartland wrote: > >> Thanks

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-16 Thread Steven Hartland
se *types.Builtin: > objKind = ast.Fun > default: > return nil, fmt.Errorf("unexpected builtin %s of type %T", o.Name(), o) > } > obj := ast.NewObj(objKind, name) > if u.Insert(obj) != nil { > return nil, fmt.Errorf("types internal error: double declaration") > }

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-16 Thread Steven Hartland
t 2:13 PM Steven Hartland > wrote: > >> I converted my code to x/tools/go/packages >> <https://pkg.go.dev/golang.org/x/tools@v0.1.7/go/packages> and while it >> did solve the problem it's VERY slow in comparison. >> >> I have a set of 21 tests operatin

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-15 Thread Steven Hartland
ts76985775 outside available modules I fixed it by calling ioutil.TempDir with "." but that's not ideal. Thoughts? On Tue, 12 Oct 2021 at 13:42, Steven Hartland wrote: > Thanks David, much appreciated, I will have a look at both. > > When migrating from go/ast to go/types did you

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-12 Thread Steven Hartland
Thanks David, much appreciated, I will have a look at both. When migrating from go/ast to go/types did you hit anything of note I should look out for? On Mon, 11 Oct 2021 at 17:06, David Finkel wrote: > > > On Mon, Oct 11, 2021 at 5:48 AM Steven Hartland > wrote: > >> If

[go-nuts] ast.NewPackage errors for built in types

2021-10-11 Thread Steven Hartland
If the ast.Files passed to ast.NewPackage includes built in types such as int it returns an error e.g. file1.go:5:6: undeclared name: int Is there a way to prevent that? Playground example: https://play.golang.org/p/Yg30TTzoLHP My goal is to take multiple files, resolve inter file dependencies

Re: [go-nuts] What is the point of gzip Reader.Close?

2021-06-21 Thread Steven Hartland
Internally close calls z.decompressor.Close() where decompressor is typically obtained via flat.NewReader(r) which states NewReader returns a new ReadCloser that can be used to read the uncompressed version of r. If r does not also implement io.ByteReader, the decompressor may read more data than

Re: [go-nuts] no generic ?

2021-02-22 Thread Steven Hartland
The proposal to add generics to go has been accepted and it is due to be added in v1.18 On Sun, 21 Feb 2021 at 21:02, alex-coder wrote: > Hi all ! > I'm just a beginner in Golang and I see a discussion in regards to > introduce generics into Go. > But is it possible to provide an example where

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Steven Hartland
Always serialise t.UTC()? On 24/07/2020 04:26, Mike Cohen wrote: To be clear, the time.MarshalJSON() function produces valid RFC 3339 timestamps which allow arbitrary timezones. This means that local time offset is used in the string representation. Although all representations are

Re: [go-nuts] Re: Variadic Arguments and Interfaces

2020-05-17 Thread Steven Hartland
Did you use the correct calling convension e.g. db.Query(query, cond...) The ... makes the slice variadic, passing echData.Active, exchData.Role instead of just a interface slice On 17/05/2020 23:27, Saied Seghatoleslami wrote: I hate to dig up something from 2012, but I have come across a

Re: [go-nuts] Too many open files / broken pipe issue.

2020-05-08 Thread Steven Hartland
Few things which may help: 1. Use pprof to look at goroutines, see if you have a leak there. 2. What does linux utility lsof say? Don't forget that each network connection uses a "file" so it may not be a real file hand instead a network socket, which given your screen shot could be due to

Re: [go-nuts] go commands hang indefinitely

2020-04-09 Thread Steven Hartland
What happens if you kill -ABRT the process? On Fri, 10 Apr 2020 at 01:16, Juan Monroy-Nieto wrote: > Hello everyone, I am compelled to stop just lurking. > > Go Version 1.14.1 on MacOS Mohave. > > Similarly to a recent post >

[go-nuts] godoc.org - Internal server error

2020-01-19 Thread Steven Hartland
Looks like somethings wrong with godoc.org atm, not sure who maintains this as every page just errors for me ATM, hence reaching out here in the hope someone who does reads this list. An example is accessing: https://godoc.org/github.com/spf13/pflag Internal server error. -- You received this

Re: [go-nuts] go 1.13.1 (linux x64): time.After not working as expected

2019-10-14 Thread Steven Hartland
Your not checking done in your for loop. On 14/10/2019 13:39, Jeff Kayser wrote: I'm working through the most excellent book "Concurrency in Go", doing the example on page 162-166.  My code is here: https://play.golang.org/p/7kokkAIdhov The program is not triggering the timeout section of

Re: [go-nuts] Is there a preferred REDIS driver or go psckage?

2019-09-09 Thread Steven Hartland
https://github.com/gomodule/redigo/ written by Gary Burd is still maintained. We actively use it in production heavily. On Mon, 9 Sep 2019 at 19:19, joe mcguckin wrote: > > > Thanks, > > Joe > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts"

Re: [go-nuts] Re: Option to disable version validation in 1.13?

2019-09-04 Thread Steven Hartland
.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 > ee948d087217' >> go.mod >echo 'replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => > mvdan.cc/unparam fbb59629db34' >> go.mod > ># this now works >go get github.com/golangci

[go-nuts] Option to disable version validation in 1.13?

2019-09-03 Thread Steven Hartland
Trying to update to 1.13 but the new version validation breaks golangci-lint installs with: invalid pseudo-version: does not match version-control timestamp https://golang.org/doc/go1.13#version-validation lists a number of options if you're maintaining a module but nothing seems relevant for

Re: [go-nuts] By passing go type check when performing bitwise operator

2019-09-01 Thread Steven Hartland
This has been changed in the upcoming 1.13 release, so you might want to try the latest release candidate. On 01/09/2019 19:03, Albert Tedja wrote:  I am trying to perform some bitwise operators, but Go is not letting me because the mask is an uint and the values are int. Setting the mask to

Re: [go-nuts] Goroutine scheduled 10 seconds too late

2019-08-24 Thread Steven Hartland
Out of interest what OS? Is the machine virtualised? You might want to try doing an OS syscall trace to see if it’s stuck in an OS call for some reason. Regards Steve On Sat, 24 Aug 2019 at 03:37, Michael Andersen wrote: > This is built with go 1.12.5, incidentally, but I have seen this

Re: [go-nuts] Re: Tips for reproducing flaky Go tests

2019-08-17 Thread Steven Hartland
We’ve found stress invaluable in helping to reproduce flaky tests https://godoc.org/golang.org/x/tools/cmd/stress On Sat, 17 Aug 2019 at 01:50, Maxim Fateev wrote: > I wish Go had a deterministic execution mode with predefined randomization > seed. The to reproduce such test you would only

Re: [go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-20 Thread Steven Hartland
You might want to see if dtrace can shed some light on this? On Sat, 20 Jul 2019 at 01:25, wrote: > > > On Friday, July 19, 2019 at 2:24:30 PM UTC-7, Steven Hartland wrote: >> >> Mat is actually running a non-standard kernel, with the ZFS filesystem >> from the

Re: [go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-19 Thread Steven Hartland
Mat is actually running a non-standard kernel, with the ZFS filesystem from the core OS replaced with a ZFS version derived from Linux ZFS port. I've not looked at the details of the port, but one suggestion would be do you see the same behaviour if you build on UFS volume while still running

Re: [go-nuts] ioutil.ReadDir error

2019-07-19 Thread Steven Hartland
If you want this behavior you'll need to use the lower level methods in the os package .     Regards     Steve On 19/07/2019 11:54, rob wrote: I have this in my code   files, err := ioutil.ReadDir(CleanDirName)   if err != nil {    

Re: [go-nuts] Does this code safe?

2019-07-05 Thread Steven Hartland
Use the same method for both Load and Set, also your example will never complete as your for loops will run forever. On 05/07/2019 15:53, Cholerae Hu wrote: | package main import ( "sync/atomic" "sync" ) func main() { var n int32 var m sync.Mutex var wg sync.WaitGroup wg.Add(2) go func() {

Re: [go-nuts] Re: Go will shine on huge web projects, but how about simple ones?

2019-06-08 Thread Steven Hartland
Couple of things that you might want to investigate: 1. Is SetReadDeadline the same as SO_RCVTIMEO (vm vs socket)? 2. Is c.Close()  the same as shutdown (flushes vs doesn't)? 3. Is print is the same as fmt.Fprintf / c.Write (buffered vs unbuffered)? With the go I'd be tempted to put everything

Re: [go-nuts] Creating HTTP API with extra '/' (without quotes) at the end of the route, takes only 'GET' request.

2019-06-07 Thread Steven Hartland
I believe this is documented here: https://golang.org/pkg/net/http/#ServeMux On 07/06/2019 07:46, Mayank Gupta wrote: Hi All, I wanted to make sure before filing an issue on Github. Here's the code using net/http package to create a restful web API. If I hit any route using Postman app, no

Re: [go-nuts] Re: Go 1.8 port to FreeBSD/PowerPC64

2019-06-04 Thread Steven Hartland
Newer versions of go require an older version of go (1.4) to bootstrap, that may be related to your issue? On 04/06/2019 04:21, Curtis Hamilton wrote: Currently. the FreeBSD port only supports "i386 amd64 armv6 armv7" and does not support powerpc64 (ppc64). I'm starting with an older version

Re: [go-nuts] Re: using channels to gather bundles from inputs for batch processing

2019-05-02 Thread Steven Hartland
You can see it doesn't wait by adding a counter as seen here: https://play.golang.org/p/-eqKggUEjhQ On 02/05/2019 21:09, Louki Sumirniy wrote: I have been spending my time today getting my knowledge of this subject adequate enough to use channels for a UDP transport with FEC creating sharded

Re: [go-nuts] Re: using channels to gather bundles from inputs for batch processing

2019-05-02 Thread Steven Hartland
Without the wait group it doesn't wait, so you're not guaranteed for all / any of the goroutines to complete. On 02/05/2019 21:09, Louki Sumirniy wrote: I have been spending my time today getting my knowledge of this subject adequate enough to use channels for a UDP transport with FEC

Re: [go-nuts] Struct's fields order affects required memory

2019-03-06 Thread Steven Hartland
With regards the size of the struct, elements are aligned by the go compiler automatically as demonstrated by the following tool: http://golang-sizeof.tips/ Are you asking why the compiler doesn't automatically change the order of fields in the struct to make the struct a minimal size?    

Re: [go-nuts] golang websocket read method doesn't get error if the android client changes its network

2019-01-29 Thread Steven Hartland
If the server doesn't do an writes or is stuck in a read you can see this behavior. Enabling keepalive on the connection should fix this. On 29/01/2019 10:57, mailme...@gmail.com wrote: I wrote a both server and client side with golang, the server side runs on centos7, and I built client side

Re: [go-nuts] gotcha: don't take the address of a for-range loop variable

2019-01-07 Thread Steven Hartland
Worth mentioning you don't need the second _ variable in range statements e.g. use:     for i := range items {    .     } vs:     for i, _ := range items {    .     } On 07/01/2019 02:24, bucha...@gmail.com wrote: https://play.golang.org/p/NnACN5fLPT3 I was taking the address

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Steven Hartland
dtrace support? On 15/11/2018 16:51, ju...@sqreen.io wrote: Hi, I am working on dynamic instrumentation of Go programs at run time, possibly without static source-code instrumentation. As I would like a solution as close to Go and standard as possible, I was first thinking of using `go

Re: [go-nuts] defining custom struct, confused

2018-09-26 Thread Steven Hartland
If you look closely they have a strange structure:  "users": [*[*{...},{...}*]*] You've created: "users":[{...},{...}] On 26/09/2018 14:43, 'Mudasir Mirza' via golang-nuts wrote: Hey guys, I am fairly new to GoLang, still learning. I am trying to working on a small utility, which fetches

Re: [go-nuts] a potential problem with go1.11 HTTP library

2018-09-25 Thread Steven Hartland
For reference this is the issue tracking the regression I believe your experiencing: https://github.com/golang/go/issues/27525 On 25/09/2018 08:36, Xiangrong Fang wrote: I have a HTTP API and its client written in Go. The client side code is: func upload(link, dir, name string, r io.Reader) {

Re: [go-nuts] a potential problem with go1.11 HTTP library

2018-09-25 Thread Steven Hartland
Sounds like a broken DNS server on the machine, this was something I saw raised before. See the thread "Performance regression of HTTP requests since Go 1.11" for more information.     Regards     Steve On 25/09/2018 08:36, Xiangrong Fang wrote: I have a HTTP API and its client written in

Re: [go-nuts] Test caching unexpectedly disabled by -exec

2018-08-28 Thread Steven Hartland
On 24/08/2018 18:00, Ian Lance Taylor wrote: On Fri, Aug 24, 2018 at 8:31 AM, Steven Hartland wrote: Hi all I've just been banging my head why test our linux test env isn't caching tests and found that its down to -exec. The docs (https://golang.org/cmd/go/#hdr-Build_and_test_caching) refer

[go-nuts] Test caching unexpectedly disabled by -exec

2018-08-24 Thread Steven Hartland
Hi all I've just been banging my head why test our linux test env isn't caching tests and found that its down to -exec. The docs (https://golang.org/cmd/go/#hdr-Build_and_test_caching) refer to cacheable "test" flags but doesn't mention standard non-test flags. In addition to this

Re: [go-nuts] Re: AWS S3 Image Upload with Golang

2018-08-16 Thread Steven Hartland
If your file out code is above your original code snippet so you have something like: https://play.golang.org/p/5MVxJamHy4c Then one of the problems is the file pointer of "out" points to the end of your file not the beginning. If you don't need the file on disk then something like the

Re: [go-nuts] Golang package docs site sluggish recently

2018-08-08 Thread Steven Hartland
This seems to happening again :( On 08/06/2018 12:26, Steven Hartland wrote: Thanks Chris appreciated, does indeed to be quick again :)     Regards     Steve On 08/06/2018 05:57, Chris Broadfoot wrote: Should be fast again now. I'm not sure what happened, but it appears the site search index

Re: [go-nuts] Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread Steven Hartland
Actually looks like its already fixed: https://github.com/golang/go/issues/24041 https://github.com/golang/go/commit/f69ad10377b1817e3db57851226a23973caa584e On 18/05/2018 13:06, mosalo...@gmail.com wrote: Hi! In version 1.9, I had no problem getting the FormValue in http request. After

Re: [go-nuts] Error getting FormValue in MultipartForm http request in Go 1.10

2018-05-18 Thread Steven Hartland
Do you have a little reproduction case you can put on playground? On 18/05/2018 13:06, mosalo...@gmail.com wrote: Hi! In version 1.9, I had no problem getting the FormValue in http request. After upgrading to version Go 1.10 of FormValue is empty. Did I find the error? in module:

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Steven Hartland
You could be seeing a side effect on fact that windows only ticks every 15ms. On Fri, 4 May 2018 at 21:56, Andrei Avram wrote: > This code is extracted from something real. Someone on the team noticed > the unit tests (which I wrote on a Linux machine) were failing

Re: [go-nuts] Re: About a channel detail, bug, defect, or intended?

2018-04-07 Thread Steven Hartland
You should use a wait group to guarantee the behaviour of this. On Sat, 7 Apr 2018 at 12:54, T L wrote: > > > On Monday, March 26, 2018 at 4:09:24 PM UTC-4, Marvin Renich wrote: >> >> It seems that you understand why you are seeing the behavior you >> reported, but you are

Re: [go-nuts] Re: Scheduler discrepancy between Linux and OS X with Gosched()

2018-04-03 Thread Steven Hartland
What I found interesting is with this code run with raw on FreeBSD takes ~1s, however running via truss to see what happening with the syscalls it takes only ~83ms e.g. > ./tst 2018/04/03 21:53:28 Finished in 998.77123ms. > truss -o t.txt ./tst 2018/04/03 21:53:31 Finished in 83.14988ms. This

Re: [go-nuts] API fixes for sync.Mutex and friends?

2018-04-03 Thread Steven Hartland
The various meta linters pick this up. I would highly recommend using: https://github.com/alecthomas/gometalinter to improve the quality of code, for this and other issues not picked up by the standard tool chain.     Regards     Steve On 03/04/2018 00:37, Andrew Pennebaker wrote: Some Go

Re: [go-nuts] Appreciating Go

2018-02-22 Thread Steven Hartland
On 22/02/2018 09:46, andrewchambe...@gmail.com wrote: Just a list of things I like about Go, thanks everyone for the hard work: snip... Minor things that could be improved in order of importance: - Ways to express immutability ... as a concurrent language it can still be easy to make

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Steven Hartland
I checked this on FreeBSD and it still works, so seems like it could be a macOS specific issue. You should raise a bug here: https://github.com/golang/go/issues It would be good to try and identify the go version which it first broke in too, as that will be helpful in identifying the change

Re: [go-nuts] [ANN] gometalinter v2.0.0 released - much faster linting

2017-12-05 Thread Steven Hartland
On 05/12/2017 05:16, Alec Thomas wrote: Hello, Through the efforts of many contributors, and in particular those of Daniel Nephin, v2.0.0 has been released. You can grab it here:   https://github.com/alecthomas/gometalinter/releases/tag/v2.0.0 The biggest change since v1.x is that linting

Re: [go-nuts] graceful restart of app with more than one tcp Listener

2017-11-07 Thread Steven Hartland
There are a number of libraries which attempt to address this, ones I've seen: * https://github.com/fvbock/endless * https://github.com/rcrowley/goagain * https://github.com/facebookgo/grace On 07/11/2017 13:33, Vasiliy Tolstov wrote: Hi! I have application that listens 2-4 tcp ports and

Re: [go-nuts] A way to detect closed channel

2017-11-07 Thread Steven Hartland
If you're using it as a signal to trigger only on close and not sending any data, you should use chan struct{}, the reason for this is is that the empty struct consumes zero storage . Also there is a multi-valued assignment form of the

Re: [go-nuts] Re: Binary Download

2017-10-26 Thread Steven Hartland
We also had Auth issues: => Attempting to fetch http://golang.org/dl/go1.9.2.src.tar.gz SSL certificate subject doesn't match host r16---sn-aigllnds.gvt1.com fetch: http://golang.org/dl/go1.9.2.src.tar.gz: Authentication error On 26/10/2017 10:54, paul.totter...@gmail.com wrote: Tried to

Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Steven Hartland
, Steven Hartland wrote: You created an infinite recursion by calling Unmarshal on the same type your unmarshalling, hence the stack overflow error. On 28/09/2017 23:59, Yaroslav Molochko wrote: Here is the code which runs: https://play.golang.org/p/ds3KZspFvE <ht

Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Steven Hartland
You created an infinite recursion by calling Unmarshal on the same type your unmarshalling, hence the stack overflow error. On 28/09/2017 23:59, Yaroslav Molochko wrote: Here is the code which runs: https://play.golang.org/p/ds3KZspFvE If you press play, it will work fine and gives an

Re: [go-nuts] Best practices for internal repository management

2017-09-23 Thread Steven Hartland
We had issues with ensuring that cross dependencies worked correctly when working with lots of independent repos, so we currently use a single repo. The main issue we see now is all go dependency managers we’ve tried have problems. We currently use glide which seems to be the best of the bunch.

Re: [go-nuts] golang and linking

2017-09-21 Thread Steven Hartland
Does quoting the flags work? On 21/09/2017 23:25, willow.pine.2...@gmail.com wrote: Hi, I have a project which requires multiple --ldflags or -ldflags. I noticed that go build only uses the last --ldflags of the commandline. Is there a way to pass multiple --ldflags and have them all be in

[go-nuts] Forcing multiple HTTP/2 connections to a single server?

2017-09-20 Thread Steven Hartland
We're looking to upgrade one of our services to enable TLS however as soon as we do that the services also going to switch to HTTP/2 which is good apart from for this service which requires multiple TCP connections to eliminate BDP issues when performing bulk downloads; think parallel

Re: [go-nuts] Re: Retrieve Unknown Rows & Columns From a MySQL Table (Golang)

2017-09-14 Thread Steven Hartland
QueryRow(..) returns a *Row but you then chained a .Scan(..) which returns an error as compile error suggests. I'm guessing you want rows, if so have a look at: https://golang.org/pkg/database/sql/#DB.Query On 15/09/2017 03:10, Alexandre K wrote: Thank you so much for your response! The code

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Steven Hartland
6:58 AM, Steven Hartland <ste...@multiplay.co.uk <mailto:ste...@multiplay.co.uk>> wrote: Numbers don't match IsLower so how about: https://play.golang.org/p/Z6q9dJZ7QK <https://play.golang.org/p/Z6q9dJZ7QK> -- You received this message because you are subsc

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Steven Hartland
Numbers don't match IsLower so how about: https://play.golang.org/p/Z6q9dJZ7QK On 06/09/2017 14:12, Tong Sun wrote: Almost, https://play.golang.org/p/6Zl_EKqFqT But thanks a lot! It's significantly shorter/better than my initial version. On Tue, Sep 5, 2017 at 6:18 PM, Michael Jones

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Steven Hartland
Sorry I was unclear, you are right, my intention was to identify where standard form size limiting is done for multipart/form-data POST requests. There is also a limit placed on "application/x-www-form-urlencoded" for POST requests unless the request body is already limited by MaxBytesReader,

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Steven Hartland
Limiting is done by the form parse: https://golang.org/pkg/net/http/#Request.ParseMultipartForm On 29/08/2017 20:40, Andrew wrote: Go 1.9 has "The new |FileHeader.Size|  field describes the size of a file in a multipart message."

Re: [go-nuts] Re: [golang-dev] Go 1.9 is released

2017-08-25 Thread Steven Hartland
On 25/08/2017 17:39, Ian Lance Taylor wrote: On Fri, Aug 25, 2017 at 1:53 AM, Steven Hartland <ste...@multiplay.co.uk> wrote: One thing I've noticed, having read through the blog post and release notes, is a mention of the issue with the netpoller is surprisingly absent. This issue has

[go-nuts] Re: [golang-dev] Go 1.9 is released

2017-08-25 Thread Steven Hartland
Thanks for everyone's hard work on this! One thing I've noticed, having read through the blog post and release notes, is a mention of the issue with the netpoller is surprisingly absent. This issue has bitten us

Re: [go-nuts] Golang 1.9 release ETA update?

2017-08-23 Thread Steven Hartland
On 23/08/2017 23:16, Ian Lance Taylor wrote: On Wed, Aug 23, 2017 at 1:23 AM, Steven Hartland <ste...@multiplay.co.uk> wrote: Hi guys I see there's three issues still pending in the 1.9 milestone. The one being at test case failure on darwin which now has a skip in and the other two a

  1   2   >