Re: [go-nuts] help

2024-02-18 Thread 'Brian Candler' via golang-nuts
Your code includes this line: log.Println("DATABASE_URL:", os.Getenv("DATABASE_URL")) What does the log message actually show? This will confirm whether the environment variable is being passed correctly or not. I note you are using a different YAML structure for "environment" under go_app than

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 docker

Re: [go-nuts] help

2024-02-18 Thread Luca Pascali
Hi. Error says that the connection string that is executed is pointing to TCP 127.0.0.1:5432 from your docker compose file there is no such string, you are correctly using go_db host name to work inside the docker network. So my guess is that you are not executing what you think you are executing

Re: [go-nuts] help

2024-02-17 Thread Sunday Ajayi
Hi guys, Please I am having a little issue with my go project using docker. I set up my Postgres db in docker with my go app but it is unable to connect. Please what could be the issue? I will share the docker-compose file and the main.go here main.go package main import ( "database/sql" "enco

Re: [go-nuts] help with thread limit

2024-01-31 Thread Robert Engels
You can use cpuctrl or similar to limit the number of visible cores when you start the process. On Jan 31, 2024, at 8:43 PM, Steve Roth wrote:I am running Go code on a shared web hosting server from a major hosting company.  Using cgroups, they limit the number of threads any user can create to 2

Re: [go-nuts] Help understanding slices, variable arguments, and passing slices to functions

2023-09-25 Thread Jan Mercl
On Mon, Sep 25, 2023 at 1:57 PM Andrew Pillar wrote: A nice discussion of slices can be found for example here: https://research.swtch.com/godata tl;dr: Yes, slices are passed by value (everything in Go is passed by value), but a slice does not contain the backing array, only a pointer to it. -

Re: [go-nuts] Help me study resources or guides

2023-05-23 Thread Marcello H
You could take a look at: https://mehdihadeli.github.io/awesome-go-education/ Op dinsdag 23 mei 2023 om 14:33:18 UTC+2 schreef Zhang Jie (Kn): > 1. https://go101.org, from beginner to true gopher > 2. go perf book, search it from github, this will teach you some > optimization techniques > 3. h

Re: [go-nuts] Help me study resources or guides

2023-05-23 Thread Zhang Jie (Kn)
1. https://go101.org, from beginner to true gopher 2. go perf book, search it from github, this will teach you some optimization techniques 3. here's a reading list about golang internals: https://hitzhangjie.notion.site/149643669e0846e6b8e3294d04a6df0d?v=e1cea88688ec4102ae5d9af8cf9ac4c7, ac

Re: [go-nuts] Help me study resources or guides

2023-05-23 Thread Zhang Jie (Kn)
Here're some good materials: 1. https://go101.org, after learning this, you will be a true gopher. 2. go语言设计实现,maybe there's no English version. When I learns golang, I want to know its internals, and I kept lots of good articles, here: https://www.notion.so/hitzhangjie/149643669e0846e6b8e3294d0

Re: [go-nuts] Help me study resources or guides

2023-05-03 Thread Kamil Ziemian
Hello, I now try to read "Go Language Specification", which you must read to became true Gopher. If you want to read this document, I offer all my help, but not overestimate me. Recently I even doubt if I'm programmer at all, maybe just advanced hobbyist. Because Go Spec my by too much for the

Re: [go-nuts] Help me study resources or guides

2023-05-02 Thread Rajesh Pandian
HI Nyilynn, I have watched Matt's Golang videos about concurrency and few others and I have to say it is Brilliant! I highly recommend it. (And Thank you Matt for the brilliant content!! ) If you are interested in books then "Learning Go" from O'reilly was also helpful to me. If you want sta

Re: [go-nuts] Help me study resources or guides

2023-04-28 Thread Matt KØDVB
You can find my video class at https://www.youtube.com/playlist?list=PLoILbKo9rG3skRCj37Kn5Zj803hhiuRK6; people seem to like it Matt > On Apr 26, 2023, at 9:45 PM, Nyilynn Htwe wrote: > > I am starting to learn GO programming language with this course >

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-18 Thread alex-coder
Ian and Andy, looks like the to string conversion works and even does not look ugly. :-) Thank you so much. пятница, 17 марта 2023 г. в 15:01:31 UTC+3, alex-coder: > Andy, thank you. > > In case there would be a choice between ugly and achievable, I must take > the last one:-) > > Another thin

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-17 Thread alex-coder
Andy, thank you. In case there would be a choice between ugly and achievable, I must take the last one:-) Another thing I have found it that it is impossible to use type as a parameter when you call to a function. How to pass type to function argument in Go - Stack Overflow

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-16 Thread Andy Balholm
I would guess that in the case of AST nodes, you're likely more interested in the *identity* of the nodes than their *values*. In that case, you should use the pointers to the nodes as your map keys. If the *values* truly are what you care about, use the go/format package to convert the node ba

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-16 Thread alex-coder
>> Sure, convert to a string and use that as a map key. :-) no, no, no. it looks very very ugly. четверг, 16 марта 2023 г. в 00:26:35 UTC+3, Ian Lance Taylor: > On Wed, Mar 15, 2023 at 2:16 PM alex-coder wrote: > > > > Ian, thank you. > > but may be the is any workaround ? > > Use as a key not

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-15 Thread Ian Lance Taylor
On Wed, Mar 15, 2023 at 2:16 PM alex-coder wrote: > > Ian, thank you. > but may be the is any workaround ? > Use as a key not directly but like a derived from those interface/structure > types ? > Of course I may declare key like string and use switch + .(type) to mimic it. Sure, convert to a st

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-15 Thread alex-coder
Ian, thank you. but may be the is any workaround ? Use as a key not directly but like a derived from those interface/structure types ? Of course I may declare key like string and use switch + .(type) to mimic it. So, a little bit more. there is a go standard package named ast. the docs about it

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-15 Thread Ian Lance Taylor
On Wed, Mar 15, 2023 at 9:17 AM alex-coder wrote: > > There is a package named ast, inside there are a lot of structures like: > ast.Comment, ast.Field, ast.Node and so on. > And I whould like to use types of those structure as a keys. > So, I could not figure out what type of the key I should use

Re: [go-nuts] Help with language change proposal

2023-03-15 Thread Landon Cooper
Thanks very much for the feedback, Axel. I didn't think it was harsh, this is just the kind of information I needed before burning needless effort on the idea. Getting started with these conversations is quite intimidating because there is so much information and history, it's hard to find what

Re: [go-nuts] Help with language change proposal

2023-03-15 Thread 'Axel Wagner' via golang-nuts
Hi, Some comments in-line: > > Who does this proposal help, and why? > go programmers who want to reduce boiler plate code. I believe you should definitely be more explicit with the problem you are trying to solve. "Today, if you want to do X, you have to write Y. That is bad, because Z". There

Re: [go-nuts] Help Bootstrapping to ESXi

2023-01-14 Thread Brian Candler
P.S. For using tinygo to generate Linux executables, see: https://tinygo.org/getting-started/install/linux/ https://tinygo.org/docs/guides/linux/ But I couldn't find the minimum kernel version requirements. On Saturday, 14 January 2023 at 11:41:21 UTC Brian Candler wrote: > On Friday, 13 January

Re: [go-nuts] Help Bootstrapping to ESXi

2023-01-14 Thread Brian Candler
On Friday, 13 January 2023 at 20:42:28 UTC mi...@newclarity.net wrote: I SSHed into the ESXi server, used wget to pull down the Golang tarball, used tar to extract it from within the ESXi shell, and then used `go run hello.go` in the ESXi shell and got a runtime error of "epollwait on fd 4 faile

Re: [go-nuts] Help Bootstrapping to ESXi

2023-01-13 Thread Anthony Brown
I think the difference is that I didn't actually do the compilation on the ESXi host itself, I just ran the binary there. 'go run hello.go' on the ESXi host will, attempt, to both compile and execute the compiled binary; I'm guessing the ESXi host itself though doesn't have some of the same sh

Re: [go-nuts] Help Bootstrapping to ESXi

2023-01-13 Thread Mike Schinkel
> On Jan 13, 2023, at 1:32 AM, Anthony Brown wrote: > > I haven't made a bootstrapped Go toolchain so I can't help with that but I > can provide the following information: > > ESXi knows how to run ELF binaries, the interesting part then becomes what > architecture of CPU do you have the ESXi

Re: [go-nuts] Help debugging a SIGSEGV - "unexpected signal during runtime execution"

2022-12-08 Thread Gerald Parker
Hi Kurtis, Thanks for the response. To be clear this issue is the defect that I'm encountering. The issue was originally logged against *v1.0.0-beta4*. I am using *v1.0.0-beta6* but the defect has not been fixed. This defect occurs when calling *

Re: [go-nuts] Help debugging a SIGSEGV - "unexpected signal during runtime execution"

2022-12-08 Thread Kurtis Rader
It superficially looks like you're running the code from https://github.com/go-vgo/robotgo/blob/master/examples/key/main.go. However, The line number 136 in main.go in the backtrace doesn't make any sense since the example code from the project only has 134 lines. Did you modify the example code? I

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-14 Thread Kevin Burke
I've added https://go-review.googlesource.com/c/go/+/412237 to try to make this obvious to more people. On Sun, Jun 12, 2022 at 2:47 AM Brian Candler wrote: > And just as an aside, I think you would be interested in the talk > "Rethinking Classical Concurrency Patterns" by Bryan C. Mills > ht

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-12 Thread Brian Candler
And just as an aside, I think you would be interested in the talk "Rethinking Classical Concurrency Patterns" by Bryan C. Mills https://www.youtube.com/watch?v=5zXAHh5tJqQ On Sunday, 12 June 2022 at 05:06:47 UTC+1 ke...@burke.dev wrote: > That's a very clear explanation, it's obvious what the pr

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-11 Thread Kevin Burke
That's a very clear explanation, it's obvious what the problem is now. Thank you! On Saturday, June 11, 2022 at 9:36:59 AM UTC-7 se...@liao.dev wrote: > sync.Cond does not affect goroutine scheduling priority, and Signal only > makes the waiting goroutine available to be scheduled, but not forc

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-11 Thread 'Sean Liao' via golang-nuts
sync.Cond does not affect goroutine scheduling priority, and Signal only makes the waiting goroutine available to be scheduled, but not force it to be. After a Signal() (and Unlock()), every other waiting worker and the flusher then contends (fairly) for the lock. What you want appears a better fit

Re: [go-nuts] Help with GOLLVM

2022-01-04 Thread 'Than McIntosh' via golang-nuts
Hi, >>The whole point of my poc was to be able to get the LLVMIR of GO then put it into an iOS app with bitcode enable. What are you saying is that it is not possible to achieve this? It's definitely outside the normal/expected use of gollvm, but it seems at least possible to do this. The key th

Re: [go-nuts] Help with GOLLVM

2022-01-03 Thread Danilo bestbug
Hello, Thanks for the answer. I've still some question then. The whole point of my poc was to be able to get the LLVMIR of GO then put it into an iOS app with bitcode enable. What are you saying is that it is not possible to achieve this? Or it's possible but I've to add the missing symbols? If is

Re: [go-nuts] Help with GOLLVM

2021-12-16 Thread 'Than McIntosh' via golang-nuts
Greetings, The code that Go compilers emit is closely tied to the Go runtime-- any compiled Go code (including *.ll files) will have references to symbols that it needs from the runtime. When you try to convert your LLVM-produced bitcode into a binary via clang helloworld.ll -o helloworldLLVM yo

Re: [go-nuts] Help Gmail Post Master

2021-09-08 Thread Kurtis Rader
Can you show us an example of the code you've written that doesn't do what you expect? Can you expand on what you mean by "some problem"? Did you read the associated documentation at https://pkg.go.dev/google.golang.org/api@v0.56.0/gmailpostmastertools/v1 and have you verified you can get those exa

Re: [go-nuts] Help with tcpserver

2021-04-01 Thread Perry Couprie
It works now i added the ReadDeadline, thanks for the help :-) Perry On Wednesday, March 31, 2021 at 1:22:20 PM UTC+2 Brian Candler wrote: > I think that in principle you are correct to perform your reads inside a > goroutine, to allow them to be received asynchronously. > > If Read() blocks, i

Re: [go-nuts] Help with tcpserver

2021-03-31 Thread Brian Candler
I think that in principle you are correct to perform your reads inside a goroutine, to allow them to be received asynchronously. If Read() blocks, it's not a problem unless you want to shut down the connection from the server side, and you can do that by setting a read timeout which will unbloc

Re: [go-nuts] Help with tcpserver

2021-03-31 Thread Perry Couprie
The protocol i am programming for sends a header of 8 bytes that contains a body length. My problem is dat c.Read(buf) is blocking. Can i read from the tcp connection non blocking ? On Wednesday, March 31, 2021 at 9:08:48 AM UTC+2 Brian Candler wrote: > On Wednesday, 31 March 2021 at 04:13:12

Re: [go-nuts] Help with tcpserver

2021-03-31 Thread Brian Candler
On Wednesday, 31 March 2021 at 04:13:12 UTC+1 matt@gmail.com wrote: > for i := 0; i > 5; i++ { > // handle a single message > n, err := c.Read(buf) > if err == io.EOF { > break > } > fmt.Fprintf(c, "Message Count %d, Data %s", i+1, buf[:n]) > I will point out that

Re: [go-nuts] Help with tcpserver

2021-03-31 Thread Perry Couprie
I am programming a binary protocol. The demo with telnet and the max of 5 messages was for testing this problem. I need to be able send even when not recieving data. The program now works, when de the client breaks the connection, there is no problem. When de server stops the connection it some

Re: [go-nuts] Help with tcpserver

2021-03-30 Thread Matt Harden
Why are you using channels for this? I see some issues in the code, but without knowing what you're actually trying to accomplish, it's hard to give advice. To do exactly what you described, I would simply change handleDeviceConnection() to look similar to this: func handleDeviceConnection(c net.

Re: [go-nuts] Help with contributing to the Golang

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 9:55 AM Kirill Prokopovich wrote: > > Hello everyone! > Can somebody help with some advice about starting contributing in Golang? > > I've already read https://golang.org/doc/contribute.html and tried to find > some issues from https://github.com/golang/go/labels/help%20wa

Re: [go-nuts] Help with code reproducing a change in Go 1.15 CL 229578

2020-06-21 Thread Florin Pățan
Hi Ian, Thank you for your reply. At the moment, I don't have any data about this. The question raised from the fact that the language in the documentation suggests that a compiler error would occur, at least to me as a user with English as a second language. So, when I created some test scen

Re: [go-nuts] Help with code reproducing a change in Go 1.15 CL 229578

2020-06-18 Thread Ian Lance Taylor
On Thu, Jun 18, 2020 at 1:54 AM Florin Pățan wrote: > > According to the Go 1.15 documentation, the change introduced in > https://golang.org/cl/229578 should change the program behavior, and users > are expected to perform modifications to their code. > > > Package unsafe's safety rules allow c

Re: [go-nuts] [HELP] Install golang.org/x/tools/present successful but cannot find the binary

2020-05-27 Thread gede . pentium
Hi Sebastien, Thanks for the answer. Yes I just realised I was installing the package instead of the command. It works now :+1: On Thursday, May 28, 2020 at 1:16:00 AM UTC+8, Sebastien Binet wrote: > > hi, > > golang.org/x/tools/present is the package. > golang.org/x/tools/cmd/present is the co

Re: [go-nuts] [HELP] Install golang.org/x/tools/present successful but cannot find the binary

2020-05-27 Thread Sebastien Binet
hi, golang.org/x/tools/present is the package. golang.org/x/tools/cmd/present is the command. you should install the command :) (which will in turn compile and install the package under the cover). hth, -s ‐‐‐ Original Message ‐‐‐ On Wednesday, May 27, 2020 7:05 AM, Gede Pentium wrot

Re: [go-nuts] Help needed - os.exec

2020-04-05 Thread Ian Lance Taylor
On Sun, Apr 5, 2020 at 3:36 PM R Srinivasan wrote: > > I cannot figure the error in the following. > package main > > import ( > "io" > "os" > "os/exec" > "strings" > ) > > func Run(args []string) { > lf, _ := os.Create("lf.log") > defer lf.Close() > cmd := exec.Command(args[0], strings.Join(args[

Re: [go-nuts] Help needed - os.exec

2020-04-05 Thread burak serdar
On Sun, Apr 5, 2020 at 4:36 PM R Srinivasan wrote: > > I cannot figure the error in the following. > cmd := exec.Command(args[0], strings.Join(args[1:], " ")) Do not join the args. You're passing one arg, "build ./", instead of two args "build" "./" to exec. Instead: cmd := exec.Command(args[0],

Re: [go-nuts] help w/ therecipe/qt

2020-03-01 Thread rob
Yes, thanks Justin.  It looks that's just what I need. --rob On 3/1/20 3:16 PM, Justin Israel wrote: On Mon, Mar 2, 2020 at 6:48 AM rob > wrote: The exact problem is one of the first in chapter 4 MainWindow::MainWindow() {     setWindowTitle("

Re: [go-nuts] help w/ therecipe/qt

2020-03-01 Thread Justin Israel
On Mon, Mar 2, 2020 at 6:48 AM rob wrote: > The exact problem is one of the first in chapter 4 > > MainWindow::MainWindow() > { > setWindowTitle("SRM System"); > setFixedSize(500, 500); > QPixmap newIcon("new.png"); > QPixmap openIcon("open.png"); > QPixmap closeIcon("close.pn

Re: [go-nuts] help w/ therecipe/qt

2020-03-01 Thread rob
The exact problem is one of the first in chapter 4 MainWindow::MainWindow() {    setWindowTitle("SRM System");    setFixedSize(500, 500);    QPixmap newIcon("new.png");    QPixmap openIcon("open.png");    QPixmap closeIcon("close.png");    // Setup File Menu    fileMenu = menuBar()->addMenu("&Fi

Re: [go-nuts] help w/ therecipe/qt

2020-02-29 Thread rob
"Getting Started w/ Qt 5," by Benjamin Baka.  Published by Packtpub On 2/29/20 2:55 PM, Rob Muhlestein wrote: Hi there Rob, would you mind sharing that book so I can share it with people on my rwxrob.live stream. I like the idea of doing what you are doing. I might be able to help you past th

Re: [go-nuts] help with using %q in fmt

2020-02-22 Thread 'simon place' via golang-nuts
Thanks a lot, i seem to have been a bit fixated on there already being more direct symmetry between print and scan. anyway, i hacked up something that is working as i wanted; https://play.golang.org/p/BZ437rSo5DU (when you think about it, a recursive solution was always going to need a buffer.

Re: [go-nuts] help with using %q in fmt

2020-02-21 Thread Ian Lance Taylor
On Fri, Feb 21, 2020 at 4:35 PM 'simon place' via golang-nuts wrote: > > basically i want to save a file name in a file (with some url styling for > human readability); > > https://play.golang.org/p/sWYbyU7nuSo > > which works, but not with a space in the name; > > https://play.golang.org/p/sswqB

Re: [go-nuts] Help with Oauth2 "grant_type=client_credentials"

2020-02-11 Thread tmack8080
This looks like what I need. Thanks Chris. On Tuesday, February 11, 2020 at 7:45:56 PM UTC-5, Chris Broadfoot wrote: > > Try this package: > https://pkg.go.dev/golang.org/x/oauth2/clientcredentials?tab=doc > > On Tue, Feb 11, 2020, 4:43 PM andrey mirtchovski > wrote: > >> i would strongly advise

Re: [go-nuts] Help with Oauth2 "grant_type=client_credentials"

2020-02-11 Thread Chris Broadfoot
Try this package: https://pkg.go.dev/golang.org/x/oauth2/clientcredentials?tab=doc On Tue, Feb 11, 2020, 4:43 PM andrey mirtchovski wrote: > i would strongly advise against implementing advice received online > for something as important as auth. my suggestion is to work with curl > from the com

Re: [go-nuts] Help with Oauth2 "grant_type=client_credentials"

2020-02-11 Thread andrey mirtchovski
i would strongly advise against implementing advice received online for something as important as auth. my suggestion is to work with curl from the command line (examples are given on the webpage you linked) until you have the process working. implementing that afterwards using http.Client will be

Re: [go-nuts] Help with Go channels and select talk

2019-12-12 Thread Egon Kocjan
On Thursday, December 12, 2019 at 3:53:07 PM UTC+1, Bryan C. Mills wrote: > > This is a bit off-topic now, but coincidentally we will have another talk >> (probably by my work colleague) that is related to one of your approaches >> from the talk: >> >> // Glob finds all items with names matching

Re: [go-nuts] Help with Go channels and select talk

2019-12-12 Thread 'Bryan C. Mills' via golang-nuts
On Thu, Dec 12, 2019 at 1:17 AM Egon Kocjan wrote: > My demo is based on a real problem in our code. The issue here is that I > cannot paste proprietary code and it's large and complex anyway. I > distilled the problem to a bidi-communication coding exercise. The "go srv" > in the real code is an

Re: [go-nuts] Help with Go channels and select talk

2019-12-11 Thread Egon Kocjan
My demo is based on a real problem in our code. The issue here is that I cannot paste proprietary code and it's large and complex anyway. I distilled the problem to a bidi-communication coding exercise. The "go srv" in the real code is an external process with stdin and stdout with a simple lin

Re: [go-nuts] Help with Go channels and select talk

2019-12-09 Thread 'Bryan C. Mills' via golang-nuts
I agree. It seems to me that the problem in example 2 is deep in the architecture of the program, not just a detail of the `select` statements. The `connect` function essentially functions as a single-worker “worker pool”, storing the data in a goroutine (specifically, in the closure of the `srv

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Robert Engels
I’m sorry, but it’s very hard to understand when you start with solutions. I think maybe clearly restating the problem will allow more people to offer up ideas. To be honest at this point I’m not really certain what you’re trying to demonstrate or why. > On Dec 8, 2019, at 12:44 AM, Egon Kocja

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Egon Kocjan
I meant lock-free as in "without explicit locks". The original challenge still stands if someone has a better solution than me: "The deadlocks in 2_1.go and 2_2.go are caused by the simplistic and wrong implementation of bidi-comm, which is what I'll be illustrating. I have three working soluti

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Robert Engels
I understand what you are saying but I’ll still suggest that your premise/design is not correct. There are plenty of useful lock free structures in Go (see github.com/robaho/go-concurrency-test) but that is not what you are attempting here... you are using async processing - these are completely

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Egon Kocjan
I'll cite myself: "I'm preparing a short talk about Go channels and select. More specifically, I want to show what not to do." and "it would be tempting to just combine two goroutines into one and handle caching in a single loop without using locks (I see developers avoid atomics and locks if th

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Robert Engels
Probably not. Go is designed for 1:1 and there is no reason to do it differently. You could probably try to write an async event driven layer (which it looks like you’ve tried) but why??? It’s like saying I’d really like my plane to float - you can do that -but most likely you want a boat inste

Re: [go-nuts] Help with Go channels and select talk

2019-12-07 Thread Egon Kocjan
I'll try to clarify as best as I can, thanks again to anyone looking at this. The simple server implementation of "output <- input+1" is here and it is not "under our control" - it's what we have to work with: https://github.com/egonk/chandemo/blob/master/server.go The test runner or client is

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread robert engels
I’m sorry but your design is not comprehendible by me, and I’ve done lots of TCP based services. i think you only need to emulate classic TCP processing - a reader thread (Go routine) on each side of the connection using range to read until closed. The connection is represented by 2 channels -

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Jason E. Aten
@Egon, I'm sure many here would jump in and assist, but you need to help us to help you by spelling out, specifically and exactly, the problem(s) you want solved. A few sentences on each challenge should suffice. -- You received this message because you are subscribed to the Google Groups "g

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Egon Kocjan
Agreed, I see goroutines in general as a big win. But what I intend to talk about in the presentation: - we have two unidirectional flows of data resembling something like a TCP socket, easy to do with two goroutines with a for loop - let's add caching, so some requests do not go to the server -

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread robert engels
To clarify, with Go’s very lightweight threads it is “doing the multiplexing for you” - often only a single CPU is consumed if the producer and consumer work cannot be parallelized, otherwise you get this concurrency “for free”. You are trying to manually perform the multiplexing - you need asyn

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Robert Engels
A channel is much closer to a pipe. There are producers and consumers and these are typically different threads of execution unless you have an event based (async) system - that is not Go. > On Dec 6, 2019, at 9:30 AM, Egon Kocjan wrote: > >  > There are goroutines in the examples of course,

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Egon Kocjan
There are goroutines in the examples of course, just a single goroutine per bidi channel seems hard. By contrast, I've worked with actor systems before and they are perfectly fine with a single fiber. On Friday, December 6, 2019 at 3:38:20 PM UTC+1, Robert Engels wrote: > > Channels are designed

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Robert Engels
Channels are designed to be used with multiple go routines - if you’re not you are doing something wrong. > On Dec 6, 2019, at 8:32 AM, Egon Kocjan wrote: > >  > Hello > > I'm preparing a short talk about Go channels and select. More specifically, I > want to show what not to do. I chose a

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-31 Thread George Hartzell
George Hartzell writes: > > Quick summary, I'm trying to understand the Go structures that cgo > gives me, how they map back onto the C structures and why a Go struct > that doesn't quite match the cgo output seems to work anyway. > [...] Ian gave me a lot of good things to chew on, but didn

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-31 Thread George Hartzell
Ian Lance Taylor writes: > [...] > OK, that is true. Since your program will be using cgo, even though > you aren't calling any C functions, it will be dynamically linked by > default. You could try using "go build -ldflags=-extldflags=-static". > I don't know whether it will work. > To c

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-30 Thread George Hartzell
George Hartzell writes: > [...] > ``` > i2c/i2c.go:15:9: cannot use &buf[0] (type *byte) as type *_Ctype_uchar > in assignment > ``` > > I can't come up with any cast that makes the compiler happy. I'm also > unsure whether that line runs afoul of this commandment: *Go code may > not sto

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-30 Thread Ian Lance Taylor
On Fri, Aug 30, 2019 at 4:57 PM George Hartzell wrote: > > Ian Lance Taylor writes: > > On Thu, Aug 29, 2019 at 6:26 PM George Hartzell > wrote: > > [...] > > There is another approach, which is to use import "C", and then write code > like > > > > const IoctlConstant = C.IoctlConstant >

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-30 Thread George Hartzell
Ian Lance Taylor writes: > On Thu, Aug 29, 2019 at 6:26 PM George Hartzell wrote: > [...] > There is another approach, which is to use import "C", and then write code > like > > const IoctlConstant = C.IoctlConstant > type GoIoctlType = C.CIoctlType > > and then use those types in code

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-30 Thread Ian Lance Taylor
On Thu, Aug 29, 2019 at 6:26 PM George Hartzell wrote: > > I suppose I *could* write a cgo library that would wrap the C-based > [i2c-tools] library, but I wanted to do it directly in Go, without > adding the [i2c-tools] dependency. > > Or, are you saying that I should create a package that does t

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-29 Thread George Hartzell
Ian Lance Taylor writes: > On Thu, Aug 29, 2019 at 5:15 PM George Hartzell wrote: > > > > Quick summary, I'm trying to understand the Go structures that cgo > > gives me, how they map back onto the C structures and why a Go struct > > that doesn't quite match the cgo output seems to work anyw

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-29 Thread Ian Lance Taylor
On Thu, Aug 29, 2019 at 5:15 PM George Hartzell wrote: > > Quick summary, I'm trying to understand the Go structures that cgo > gives me, how they map back onto the C structures and why a Go struct > that doesn't quite match the cgo output seems to work anyway. > > I've called out two explicit que

Re: [go-nuts] [help] trying to use gccgo but missing something

2019-06-03 Thread Ian Lance Taylor
On Mon, Jun 3, 2019 at 1:59 PM anthony Place wrote: > > there is a 100 or so containing gccgo; '.go','.a','.c', batch and '.html' but > no executable (other than the batch files) > > i was previously hopeful about one called 'gccgo_install.html', but it was > about compilation and then assumed t

Re: [go-nuts] [help] trying to use gccgo but missing something

2019-06-03 Thread anthony Place
there is a 100 or so containing gccgo; '.go','.a','.c', batch and '.html' but no executable (other than the batch files) i was previously hopeful about one called 'gccgo_install.html', but it was about compilation and then assumed the executable existed. it seems something was not set to make t

Re: [go-nuts] [help] trying to use gccgo but missing something

2019-06-03 Thread Ian Lance Taylor
On Mon, Jun 3, 2019 at 12:54 PM anthony Place wrote: > > > What does "which gccgo" print? > > which: no gccgo in (/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin) > > i was wondering if i had to add something to the path, or that it wasn't > being packaged, but.. > > * gcc doc says go supported. Yes, Go

Re: [go-nuts] [help] trying to use gccgo but missing something

2019-06-03 Thread anthony Place
> What does "which gccgo" print? which: no gccgo in (/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin) i was wondering if i had to add something to the path, or that it wasn't being packaged, but.. * gcc doc says go supported. * if i search the fs for gccgo i get all sorts of hits. -- You receive

Re: [go-nuts] [help] trying to use gccgo but missing something

2019-06-03 Thread Ian Lance Taylor
On Mon, Jun 3, 2019 at 8:48 AM anthony Place wrote: > > i hoped adding -compiler gccgo to go build would just work but... > > > gccgo: exec: "gccgo": executable file not found in $PATH > > i have gcc (8.3) repo. package (solus 5) installed and the docs with it say > it supports go, and there does

Re: [go-nuts] Help - Mongodb JSON access

2019-02-19 Thread Burak Serdar
On Tue, Feb 19, 2019 at 9:09 AM wrote: > > Hi, > > I have a json data in mongodb in the format be bellow, i need help to access > the data using > the "nfinstanceID" which is a uuid string ID part of an api request for > example example > > "http://localhost:5050/nnrf-nfm/v1/nf-instances/3fa85

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 []

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. To

Re: [go-nuts] help- i cant run program

2019-01-17 Thread Ian Lance Taylor
On Thu, Jan 17, 2019 at 5:41 PM wrote: > > hay > Help, while I'm running and getting this error > > > cannot find package "fmt" in any of: C:\Go\bin\src\fmt (from $GOROOT) > C:\Users\HP\go\src\fmt (from $GOPATH) package . imports runtime: cannot find > package "runtime" in any of: C:\Go\bin\src\

Re: [go-nuts] help(rest call failed)

2018-11-12 Thread Justin Israel
On Tue, Nov 13, 2018, 5:23 AM wrote: > I just want to send a rest call with golang, but it failed, the error > message : {"header":{"code":201,"desc":"param data not exist"}} .(but > when I send rest request with postman ,it success) > the code as follow > > 1 package main > 2 > 3 import

Re: [go-nuts] Help with bytes/writing to aws

2018-09-18 Thread 'Borman, Paul' via golang-nuts
It is not possible to tell from your code if that is the correct data or not. You code did not display the data it was sending (that might be illuminating). Are you sure that when you are reading the file you are displaying what was actually there? Also, why are you specifying: Conte

Re: [go-nuts] Help

2018-09-06 Thread andybons via golang-nuts
On Wednesday, September 5, 2018 at 2:01:20 PM UTC-4, Matthias B. wrote: > > On Wed, 5 Sep 2018 19:14:43 +0530 > Kathiresh Kumar > wrote: > > > How can I connect golang with mongoDB > > > > http://lmgtfy.com/?q=How+can+I+connect+golang+with+mongoDB%3F%3F%3F%3F > This is not a particularl

Re: [go-nuts] Help

2018-09-05 Thread Kathiresh Kumar
Thank you friends. On Sep 5, 2018 11:31 PM, "Matthias B." wrote: > On Wed, 5 Sep 2018 19:14:43 +0530 > Kathiresh Kumar wrote: > > > How can I connect golang with mongoDB > > > > http://lmgtfy.com/?q=How+can+I+connect+golang+with+mongoDB%3F%3F%3F%3F > > -- > You received this message bec

Re: [go-nuts] Help

2018-09-05 Thread Matthias B.
On Wed, 5 Sep 2018 19:14:43 +0530 Kathiresh Kumar wrote: > How can I connect golang with mongoDB > http://lmgtfy.com/?q=How+can+I+connect+golang+with+mongoDB%3F%3F%3F%3F -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] help seek: creating and using go package

2018-09-04 Thread Sam Whited
On Tue, Sep 4, 2018, at 01:33, Sayan Shankhari wrote: > Probably I am making some nonsense post here and disturbing you but as a > beginner, I want to know how in Go I can implement the following. If I can > not, please suggest me suitable solution: Not at all; welcome! If you're just getting st

Re: [go-nuts] help with using crc32.Update for BE data.

2018-08-22 Thread Dan Kortschak
No, I don't think that works. Dan On Wed, 2018-08-22 at 12:04 +0200, Jan Mercl wrote: > On Wed, Aug 22, 2018 at 7:23 AM Dan Kortschak .edu.au> > wrote: > > > > > https://stackoverflow.com/questions/51960305/convert-crc32-sum-from > > - > lsb-first-algorithm-to-sum-for-msb-first-algorithm >

Re: [go-nuts] help with using crc32.Update for BE data.

2018-08-22 Thread Jan Mercl
On Wed, Aug 22, 2018 at 7:23 AM Dan Kortschak wrote: > https://stackoverflow.com/questions/51960305/convert-crc32-sum-from- lsb-first-algorithm-to-sum-for-msb-first-algorithm

Re: [go-nuts] help with using crc32.Update for BE data.

2018-08-21 Thread Dan Kortschak
Question cross-posted to SO because crickets scare me. https://stackoverflow.com/questions/51960305/convert-crc32-sum-from- lsb-first-algorithm-to-sum-for-msb-first-algorithm On Sun, 2018-08-19 at 09:27 +0930, Dan Kortschak wrote: > I am working on an MPEG-TS-using package at the moment and need

  1   2   >