Have a look at:
https://github.com/chzyer/readline
https://github.com/chzyer/readline/blob/master/example/readline-demo/readline-demo.go
On Tuesday, 17 December 2019 09:10:28 UTC-5, Rich wrote:
>
> I need to write a program that runs an external program and the user needs
> to interact with tha
Like Christian said, your main problem is how Javascript and how Go iterate.
In your Javascript example, you use:
for(var i=0;ihttps://play.golang.org/p/23nMX2dFhJF
On Sunday, 20 January 2019 10:14:05 UTC-5, Soorya Prakash wrote:
>
>
> I am using the below code to encrypt and decrypt the data.
A very nice tool from Matt Godbolt (and team of volunteers):
https://godbolt.org/z/4nt5cJ
You can switch compiler version (e.g. Go 1.4, 1.7, 1.9, 1.11, tip, etc)
and/or gccgo, take a look at variations, etc
On Saturday, 24 November 2018 11:07:51 UTC-5, Jan Mercl wrote:
>
> On Sat, Nov 24, 2018
Two things:
1) Capitalize users inside allUsers so it can be populated via reflection
2) Use an intermediary type to allow for that slice inside slice
https://play.golang.org/p/RvW7PMSOZlq
On Wednesday, 26 September 2018 10:10:41 UTC-4, Mudasir Mirza wrote:
>
> Also as per the API documentation
Hi Paul,
Check out: https://golang.org/doc/effective_go.html#pointers_vs_values
Basically, in your index1, the opts.isDigit passed to IndexFunc is
syntactic sugar for (&opts).isDigit -> then the compiler needs to move opts
on the heap.
You can either
a) define an alternate isDigitVal method,
Hi John
If you look at the source code, you will notice that the User struct they
have makes use of a custom MarshallJSON method, which accepts
ForceSendFields (as defined inside the User type)
So what you might need to do, is add that "Suspended" into that slice and
it will marshall it to JSO
your assumption: "As long as two goroutines are not modifying the same item
in an array, accessing it is safe." is not entirely correct, or is
incomplete.
Even when only one goroutine is writing to that item, and a different one
or more are reading, you still got a race, and the race detector
Kaveh, for this particular circumstance, based on your playground snippet,
that's why you got no race.
As per the original 2013 race detector blog post, "Because of its design,
the race detector can detect race conditions only when they are actually
triggered by running code, which means it's
Hi Kaveh,
Change the line:
*ptr = append(*ptr, []byte(fmt.Sprint*f("%02d"*, k1))...)
to
*ptr = append(*ptr, []byte(fmt.Sprintf(*"%15d"*, k1))...)
The buckets will overlap (more than 10 bytes) and you will get the race
triggered in the detector
Silviu
On Saturday, 21 April 2018 12:40:04 UTC-4
Hmm... I actually looked at that .On method. It does in fact call
Subscribe(), then spawns a go routine. Strange, so maybe it is a device
specific issue.
Maybe try to move those .On handlers before the work := func() block, just
in case...
On Monday, 12 February 2018 00:41:58 UTC-5, Silviu Ca
Hi Curtis,
I used to play a bit with a Beaglebone Black a few years ago, but it's now
gathering dust at my father's place. I really liked it at the time.
Can you double check that you are correctly using your *work := func() ...*
construct ?
Here's what that documentation of the gobot.NewRobot
Hi,
I think your answer can be found in this
section: https://golang.org/ref/spec#SendStmt
"Both the channel and the *value expression are evaluated* before
communication begins"
cheers,
silviu
On Sunday, 31 December 2017 01:44:31 UTC-5, dc0d wrote:
>
> Assume there is this select statement:
Hein, you can try passing a function to the template. That is, a function
which de-normalizes your person struct into an ad-hoc Num + Name record
See here: https://play.golang.org/p/1XIIO-0lcu
Cheers
Silviu
On Friday, 6 October 2017 01:22:49 UTC-4, Hein Meling wrote:
>
> Hi all,
>
> Please see
Steven, no problem. For more details have a look at
a) This talk by Sameer Ajmani: https://vimeo.com/115309491
b) Francesc Campoy's series of
videos: https://github.com/campoy/justforfunc
In the Readme, you'll find likes to episodes 9 and 10, which deal with
explaning and implementing the conte
Hi Steven,
In case it's still unclear, you need to wrap both the "do request" + "read
body" inside the same cancellation context. The "defer cancel" should
encompass both of them, sort of atomically, so the idea is to take it out
of your fetch, one level up.
https://play.golang.org/p/trMP7Q-ma
This library https://github.com/plandem/xlsx that was advertised here a few
days ago worked for me with your initial test.xlsx
On Wednesday, 30 August 2017 18:42:19 UTC-4, G Shields wrote:
>
> Tried the trick with saving under LibreOffice and MS excel, and in both
> cases the files created are d
Interesting... For this portion of code:
https://github.com/360EntSecGroup-Skylar/excelize/blob/master/rows.go#L76-L85
The xml decoder returns row and col token types for 1.8.3 but rushes into
an EOF for 1.9
If the document gets re-saved with LibreOffice for example, it works, so it
may be in
Hi Sofiane,
"Is my design wrong?"
Without a bigger picture of what your final aim is, it's hard for an
external observer to tell you if your design is right or wrong.
I was unable to fully grasp the need for that intermediate (CSV prefixed)
structs in-between raw csv and real domain types, so I
Hi Sofiane,
Answering the "what type" question is pretty much unavoidable.
You can embed that forking logic inside the "on the fly" function, like in
Roger's example (using a switch v := v.(type) construct) or you can use
reflect.
Alternatively, you can group your transformation functions into
Before: myfn := func(v CSVFloat) CSVFloat { return v }
After: myfn := func(v Valuer) Valuer { return v }
On Wednesday, 19 July 2017 16:48:07 UTC-4, Sofiane Cherchalli wrote:
>
> Hi!
>
> I'm a noob in Go and I need some guidance/help on this:
> https://play.golang.org/p/0TGzKiYQZn
>
> Basically I
Hi
I think you wanted return ahost == bhost (instead of aport == bport) inside
the addrCmp function, right ? Because the client is always assigned a
random port for a TCP connection
And of course, you will have to compare at nc (net.Conn) level, not at
listener level, especially when listenin
Hi Adam,
Back in 2014 I had the same driving motives like you and I ended up writing
my own generator for Postgres (to deal with tables, views, and functions,
for the basic types):
https://github.com/silviucm/pgtogogen
https://www.cmscomputing.com/articles/programming/generate-go-entities-from-
22 matches
Mail list logo