Re: [go-nuts] Go vs C speed - What am I doing wrong?

2019-02-11 Thread 'Isaac Gouy' via golang-nuts
On Saturday, February 9, 2019 at 9:30:25 AM UTC-8, Isaac Gouy wrote: > On Tuesday, February 5, 2019 at 3:03:42 AM UTC-8, ohir wrote: > >> >> > Contributors can recreate the same benchmarking routines in C, golang, >> JS >> >> This is how "benchmark game" **entertaining** sites are

[go-nuts] Parsing date with Timezone doesn't return UTC

2019-02-11 Thread stejcz
Hi all, please could you help me with a simple problem? I have some parsing code like this: https://play.golang.org/p/6bVyWg4FCVN It writes 20190211T103847+ 2019-02-11 10:38:47 + *UTC* on the server. When I put the code into test, package tcx_test import ( "fmt" "testing" "time"

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Thanks for the help and quick response Tyler. On Mon, 11 Feb 2019 at 17:56, Tyler Compton wrote: > Constant expressions like 'A' or 3 or named constants like "const x = 7" > are what Go calls "untyped constants". The type of these constants are > determined by the context in which they're used.

Re: [go-nuts] Go vs C speed - What am I doing wrong?

2019-02-11 Thread 'Isaac Gouy' via golang-nuts
On Saturday, February 9, 2019 at 9:20:41 AM UTC-8, Isaac Gouy wrote: > > > On Sunday, February 3, 2019 at 10:44:11 AM UTC-8, Milind Thombre wrote: >> >> … a quantitative performance study/Benchmarking study … If a verifiable >> (unbiased) study is already done and published, I'd greatly

[go-nuts] Handling connection retries on a highly-available service

2019-02-11 Thread Tamás Gulácsi
If this process is mission-critical, I'd turn it around, have it log to stdout, push that stdout to files with svlogd (from runit) and move that to the log server. The reason is that if this process has to implement the log retrying logic, that is a priority inversion. It's better to buffer

Re: [go-nuts] Parsing date with Timezone doesn't return UTC

2019-02-11 Thread Ian Lance Taylor
On Mon, Feb 11, 2019 at 10:53 AM wrote: > > Hi all, please could you help me with a simple problem? > > I have some parsing code like this: https://play.golang.org/p/6bVyWg4FCVN > > It writes > > 20190211T103847+ > > 2019-02-11 10:38:47 + UTC > > > on the server. > > When I put the code

[go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Hello, Can you help? https://play.golang.org/p/XfJZ3h06p60 Why does 'A' work, when first assigning it to a variable doesn't? Thank you, Jamie. -- 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] Mismatched types work sometimes?

2019-02-11 Thread Tyler Compton
Constant expressions like 'A' or 3 or named constants like "const x = 7" are what Go calls "untyped constants". The type of these constants are determined by the context in which they're used. For example: const myConst = 3 myFloat := 2.5 fmt.Println(myFloat + myConst) fmt.Println(myFloat + 3)

[go-nuts] Job Posting from a multinational company in Silicon Valley

2019-02-11 Thread lynnzhou999
We are seeking Staff engineer to lead Cloud Native Application initiative. We are taking our strength and leadership in compute and virtualization and extending it from a VM-centric focus to managing app-centric, containerized workloads using Kubernetes, Docker, and other emerging container

Re: [go-nuts] ZXBasic string slicing

2019-02-11 Thread Dan Kortschak
https://play.golang.org/p/6GqrX15gXZ7 On Mon, 2019-02-11 at 13:04 -0800, Everton Marques wrote: > Funny feature from ZXBasic: > > There is a notation called slicing for describing substrings, and > this can  > be applied to arbitrary string expressions. > > `"abcdef"(2 TO 5)="bcde"` > >

[go-nuts] Go 1.12 Release Candidate 1 is released

2019-02-11 Thread Andrew Bonventre
Hello gophers, We have just released go1.12rc1, a release candidate version of Go 1.12. It is cut from release-branch.go1.12 at the revision tagged go1.12rc1. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable.

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Rob Pike
You might find blog.golang.org/constants helpful. -rob On Tue, Feb 12, 2019 at 5:04 AM Jamie Caldwell wrote: > Thanks for the help and quick response Tyler. > > On Mon, 11 Feb 2019 at 17:56, Tyler Compton wrote: > >> Constant expressions like 'A' or 3 or named constants like "const x = 7" >>

[go-nuts] ZXBasic string slicing

2019-02-11 Thread Everton Marques
Funny feature from ZXBasic: There is a notation called slicing for describing substrings, and this can be applied to arbitrary string expressions. `"abcdef"(2 TO 5)="bcde"` http://www.worldofspectrum.org/ZXBasicManual/zxmanchap8.html -- You received this message because you are subscribed

Re: [go-nuts] Mismatched types work sometimes?

2019-02-11 Thread Jamie Caldwell
Cheers Rob, I'll certainly read that. On Mon, 11 Feb 2019 at 20:53, Rob Pike wrote: > You might find blog.golang.org/constants helpful. > > -rob > > > On Tue, Feb 12, 2019 at 5:04 AM Jamie Caldwell < > mr.jamie.caldw...@gmail.com> wrote: > >> Thanks for the help and quick response Tyler. >> >>

Re: [go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-11 Thread 'Isaac Gouy' via golang-nuts
> On Monday, February 11, 2019, 10:59:20 AM PST, Robert Engels wrote: > > Please don’t base any decisions on the benchmark games. They are seriously > flawed. > Someone could write "They are seriously flawed." without ever having looked to see :-) -- You received this message because

[go-nuts] TLS Trusted Certificate Authority (TCA) Extension Support

2019-02-11 Thread dan
Bare with me on this, as I explain where I'm coming from and where I'm trying to go. We've integrated Go into our code base as a separate service that communicates with some server code through TLS. For the most part, this worked flawlessly through Go 1.10. We were affected by some of the Go

[go-nuts] Golang closures, counter-intuitive behaviour

2019-02-11 Thread Slawomir Pryczek
Hi Guys, When looking at this code below, you can see that the function will get LAST value of i which is incremented inside the loop, but t is somehow copied and taken inside a function so closure is created and it is bound to current value of t, so we'll have its current value in function.

Re: [go-nuts] Golang closures, counter-intuitive behaviour

2019-02-11 Thread Ian Lance Taylor
On Mon, Feb 11, 2019 at 4:48 PM Slawomir Pryczek wrote: > > When looking at this code below, you can see that the function will get LAST > value of i which is incremented inside the loop, but t is somehow copied and > taken inside a function so closure is created and it is bound to current >

[go-nuts] GAE import of cloud and appengine data stores fails when in same file

2019-02-11 Thread Dan Kortschak
One of our developers has found that when they import both "google.golang.org/appengine/datastore" and "cloud.google.com/go/datastore", renaming the second import to remoteds, the build on AE fails, though it does not fail locally with dev_appserver.py. This only happens when the imports are in

[go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-11 Thread Henry
Micro optimization is only a small part of the picture. While you can shave off a few ms with micro optimization, you can save much more with macro optimization. Macro optimization deals with algorithm, program design, caching, etc. This is why some people consider language vs language

[go-nuts] Re: Handling connection retries on a highly-available service

2019-02-11 Thread Space A.
It has absolutely nothing to do with mutexes/contexts/atomics or even Go (even if you program in Go). This is engineering or architecture task not the language thing, so you need to think like an architect. A lot of solutions possible if you add some sort of integration layer between P and

Re: [go-nuts] How to run some unittest repeatedly without build cache?

2019-02-11 Thread Ian Lance Taylor
On Mon, Feb 11, 2019 at 10:32 PM Cholerae Hu wrote: > > Some bugs caused by data race cannot be detected by running unittest only > once. Before Go 1.12, I can use GOCACHE=off go test -race . to force it to > run without cache, but GOCACHE=on is required as of Go 1.12. So how can I >

[go-nuts] How to run some unittest repeatedly without build cache?

2019-02-11 Thread Cholerae Hu
Some bugs caused by data race cannot be detected by running unittest only once. Before Go 1.12, I can use GOCACHE=off go test -race . to force it to run without cache, but GOCACHE=on is required as of Go 1.12. So how can I workaround this? -- You received this message because you are

Re: [go-nuts] Go vs C speed - What am I doing wrong?

2019-02-11 Thread Wojciech S. Czarnecki
On Sat, 9 Feb 2019 09:30:24 -0800 (PST) "'Isaac Gouy' via golang-nuts" wrote: > > *"Look at the history of java samples and benchmark earlier vs current at > > same task"* > and conclude what? That some languages demands very deep intrinsic knowledge to get code running faster than in its

Re: [go-nuts] Enumerate query result fields using "github.com/go-ole/go-ole/oleutil"

2019-02-11 Thread Lutz Horn
Any ideas on how I can get a list of fields (not values) after executing something like this? Try these: * https://golang.org/pkg/database/sql/#Rows.Columns * https://golang.org/pkg/database/sql/#Rows.ColumnTypes These methods give you information about the columns of a sql.Row. Lutz --

Re: [go-nuts] Help- Empty request header and body

2019-02-11 Thread Lutz Horn
Am new in golang and am trying to write an API but my request header and body is always empty. Well, that's a *lot* of code. Please trim it so it forms a SSCCE (http://www.sscce.org/). Lutz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] Go modules do not respect vendor folder of dependencies (is this by design?)

2019-02-11 Thread 'Bryan Mills' via golang-nuts
The fact that a module-mode build ignores dependencies vendored into *other* modules is intentional. #27227 may change several details of vendoring in module mode, but this is not one of them. If module B vendors its dependencies but does not specify their versions in a go.mod file, then you

Re: [go-nuts] Re: Documention of a blog entry out of date

2019-02-11 Thread Victor Giordano
Hi Peter! Thank for updating the reference, so instead of looking decode i DO see panics and reconver in encode.go!! I guess there is slight inconsistency in the go blog. I will help you guys (and help me, and others) by pointing this out in the proper place. Greetings V El lun., 11 feb. 2019

Re: [go-nuts] Basic Data structures and Algorithms with Go

2019-02-11 Thread Lutz Horn
The first chapter of my book from packt is available on golangweekly. Book Title: "Basic Data structures and Algorithms with Go". Some quick observations: The code indention of many code snippets is broken. Example: https://i.postimg.cc/6QFyMVjr/twic-Value.png The terminal windows are

[go-nuts] Re: Documention of a blog entry out of date

2019-02-11 Thread peterGo
Victor, If you look at the source code, you may find that the blog inadvertently switched decode and encode. See encode.go. Reporting issues: If you spot bugs, mistakes, or inconsistencies in the Go project's code or documentation, please let us know by filing a ticket on our issue tracker.

[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()* *

[go-nuts] Documention of a blog entry out of date

2019-02-11 Thread Victor Giordano
Dear all i was reading The defer, panic and recover entry at the go blog until i found this statement: For a real-world example of panic and recover, see the json package from > the Go standard library. It decodes JSON-encoded data with a set of

Re: [go-nuts] Help- Empty request header and body

2019-02-11 Thread afriyie . abraham
Hi, Please attacted is app files (unnecessary codes deleted). I don’t if I could made mode simpler but this is how am able let you identify the problem am encountering when I run this code. I tried to print the request header and body and this is what am getting ] &{{ObjectIdHex("") 0 0

[go-nuts] Basic Data structures and Algorithms with Go

2019-02-11 Thread Bhagvan Kommadi
The first chapter of my book from packt is available on golangweekly. Book Title: "Basic Data structures and Algorithms with Go". Check out the golangweekly : https://golangweekly.com/link/59052/5d605019f3 The code for the book is available at: https://lnkd.in/f-Dy_Z4

[go-nuts] Handling connection retries on a highly-available service

2019-02-11 Thread Michel Levieux
Hi guys. I need a little help here. I work in a digital marketing company, where we have a program that receives a lot of requests every second (counted in thousands) and logs its behaviour via a logger that runs on another server. We are currently trying to implement a connection-retry system