Re: [go-nuts] Making a post call with multiple instances of the same struct

2024-08-05 Thread G K
into a Go value. It unmarshals fine you define the var Lock model.Lock as just a struct. On Monday, August 5, 2024 at 11:37:26 AM UTC-5 Ian Lance Taylor wrote: > On Mon, Aug 5, 2024 at 6:55 AM G K wrote: > > > > I'm trying to create an HTTP rest api end where a POST method wi

[go-nuts] Making a post call with multiple instances of the same struct

2024-08-05 Thread G K
Hi, I'm trying to create an HTTP rest api end where a POST method will be able to accept and deserialize (unmarshall) a same data structre into numerous instances. For the sake of example, lets say I have json struct: type Lock struct { Key uint `json:"key"` } Nom Im trying to post uns

[go-nuts] Re: Error on installing package

2024-02-07 Thread Smit K
M UTC-5 Jason Phillips wrote: > >> There's no Go package at the root of that repo/module, and thus nothing >> to install. "go install" only works on main packages. >> >> On Tuesday, February 6, 2024 at 8:34:07 AM UTC-5 Smit K wrote: >> >>> With t

[go-nuts] Error on installing package

2024-02-06 Thread Smit K
With this command: go install 154.pages.dev/google@v1.4.0 It is not installing: [image: Screenshot 2024-02-06 180047.png] -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an em

[go-nuts] x/mobile: Extend support for non Android java platform

2023-02-24 Thread K
- Change all auto-generated files to match the correct platform. Personally I want to use Go with the Kotlin Desktop Compose. I want to ask before I start, are any of it interesting to the "x/mobile" team or not? K -- You received this message because you are subscribed to the Go

[go-nuts] Re: Unable to create Api | Go Operator | Go issue

2022-11-04 Thread B K
Any fix for this yet? On Thursday, 18 November 2021 at 20:19:36 UTC+2 Dinesh kumar Ramasamy wrote: > I do see the same issue - No fix yet. > > On Monday, November 1, 2021 at 11:30:30 AM UTC-5 Vaishali Gupta wrote: > >> Hello Team >> >> getting below error while using below command >> could you

Re: [go-nuts] How to call sort.Search in a loop

2022-10-11 Thread K. Alex Mills
Ah, my last post had a small mistake. A small modification to upper should be all you need. The function should use >= instead of >. See below. upper := sort.Search(len(haystack), func(i int) bool { return haystack[i].name >= needle.name }) On Tue, Oct 11, 2022, 7:38 AM K. A

Re: [go-nuts] How to call sort.Search in a loop

2022-10-11 Thread K. Alex Mills
sort.Search runs binary search. It's only guaranteed to work when you provide it with a function which is monotonic -- true at index i implies true at all indices greater than i. Your loop style search does not provide a monotonic function, whereas your "upper" function is monotonic. However, sinc

Re: [go-nuts] Is there a better way to write this?

2022-09-15 Thread K. Alex Mills
The only alternatives that I see would each introduce an extra call to Add, like the below. I'm not sure if this is much less "clunky", but it at least avoids the reassignment to s. func collectStringsetMap(m map[string]*stringset.Set, key string, value ...string) *stringset.Set { if s, ok := m[

[go-nuts] github.com/splunk/pipelines hits v1.0.0

2022-08-20 Thread K. Alex Mills
t and combine pipeline stages as pairs. * Handle fatal and non-fatal errors from any pipeline stage. * Sinks for draining the result of a pipeline computation. Some future enhancements are planned. Please leave any suggestions or issues in the issue tracker. Thanks K. Alex Mills -- You received

Re: [go-nuts] Re: Why declaring multiple variable at once for same type feature exists in Golang?

2022-08-18 Thread K. Alex Mills
Yes. Declaring i and j on the same line is certainly cleaner. We should all do it like that. Am I missing something? On Thu, Aug 18, 2022, 9:25 PM Yasser Sinjab wrote: > Thanks, I don't object it personally, but I had a debate about "grouping > variables is considered a clean code". > > Let's s

Re: [go-nuts] gofmt 1.19 reformats comments in a way which breaks go-swagger

2022-08-17 Thread K. Alex Mills
I would hesitate to call this a bug in gofmt. Go released new godoc features as part of Go 1.19, along with reformatting of comments. Those features were entirely intentional. The decision made in the go-swagger project to place its comments alongside godoc comment blocks was a risky one in case o

Re: [go-nuts] Application Monitoring

2022-08-16 Thread K. Alex Mills
Monitoring and observability are best practices regardless of what language you use. We use a combination of Prometheus / Grafana and metrics exported by runtime/metrics. We also include custom metrics tailored to our application's use-case. Prometheus is not a standard Linux tool, but it is open

Re: [go-nuts] Pipelining with Go and Generics

2022-08-11 Thread K. Alex Mills
rs to methods, so a method like Map() on a stream instance can’t be > written - because the stream is of type T, and the Map() produces a stream > of type R. > > psuedo code: > > type Stream[T any] interface { > ... > Map[R any](func (T) R) Stream[R] // syntax not su

Re: [go-nuts] Pipelining with Go and Generics

2022-08-11 Thread K. Alex Mills
Ah, my apologies, I was wrong. Panicking in the midst of a func passed to one of these pipeline stages most certainly *will not* shut down the entire pipeline and cannot be recovered like I had suggested. Sorry about that. Sincerely, K. Alex Mills On Thu, Aug 11, 2022 at 4:56 PM K. Alex Mills

Re: [go-nuts] Pipelining with Go and Generics

2022-08-11 Thread K. Alex Mills
hing stopping you from doing so with this library. Just use recover at the top of the func that spins up the pipeline and use context.WithCancel to shut the rest of the pipeline down in that case. Let me know if that's unclear and I'll do my best to provide an example. Sincerely, K. Ale

Re: [go-nuts] Pipelining with Go and Generics

2022-08-11 Thread K. Alex Mills
ecause chaining is impossible with error returns. > > A streams api with panic/recover is needed. > > On Aug 11, 2022, at 12:55 PM, K. Alex Mills > wrote: > >  > Hello Gophers, > > I recently had an opportunity to try out Go generics on a small pipelines > packag

[go-nuts] Pipelining with Go and Generics

2022-08-11 Thread K. Alex Mills
tps://kalexmills.com/journal/pipelines/>. I'm open to any of your thoughts, suggestions, and issue reports. Sincerely, K. Alex Mills -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

Re: [go-nuts] Re: Basic question on Channels

2022-07-27 Thread Aravindhan K
t;>> On Wednesday, 27 July 2022 at 08:13:34 UTC+1 aravind...@gmail.com >>>> wrote: >>>> >>>>> Hi All, >>>>> When I was explaining basics of channels to newcomers, I was using the >>>>> below example >>>>> ht

Re: [go-nuts] Re: Basic question on Channels

2022-07-27 Thread Aravindhan K
xpecting both Write 5 and Write 3 to be printed. But only Write 5 >>> was printed. I couldn't reason out the behaviour, can somebody point out >>> what I am assuming wrong about. >>> >>> Thanks, >>> Aravindhan K >>> >> -- > You received th

[go-nuts] Basic question on Channels

2022-07-27 Thread Aravindhan K
wrong about. Thanks, Aravindhan K -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion o

Re: [go-nuts] Re: Pod memory keeps on increasing and restart with error OOMKilled

2022-03-10 Thread Rakesh K R
configuration. so I am confused now On Friday, March 11, 2022 at 1:34:23 AM UTC+5:30 ren...@ix.netcom.com wrote: > Look at log.retention.hours and log.retention.bytes > > You should post this in the Kafka forums not the Go ones. > > On Mar 10, 2022, at 11:04 AM, Rakesh K R wrote: >

Re: [go-nuts] Re: Pod memory keeps on increasing and restart with error OOMKilled

2022-03-10 Thread Rakesh K R
ome other option to store on disk. > > On Mar 10, 2022, at 10:07 AM, Rakesh K R wrote: > > Tamas, > > Thanks you. So any suggestion on how to make application release this > 900MiB memory back to OS so that pod will not end up in OOMKilled state? > > On Thursday, March 1

[go-nuts] Re: Pod memory keeps on increasing and restart with error OOMKilled

2022-03-10 Thread Rakesh K R
tes > > says it uses cgo, hiding it's memory usage from Go. I bet that 900MiB of > memory is there... > > > Rakesh K R a következőt írta (2022. március 10., csütörtök, 7:26:57 UTC+1): > >> HI, >> I have a micro service application deployed on kubernetes cluster(wi

[go-nuts] Pod memory keeps on increasing and restart with error OOMKilled

2022-03-09 Thread Rakesh K R
HI, I have a micro service application deployed on kubernetes cluster(with 1gb of pod memory limit). This app receive continuous messages(500 message per second) from producer app over kafka interface(these messages are encoded in protobuf format.) *Basic application flow:* 1. Get the message o

[go-nuts] Re: in-memory caching in golang

2022-03-09 Thread Rakesh K R
.Order[1:] >> } >> } >> >> If you really need a Time To Live and want to allow memory to balloon >> uncontrolled, then MaxSize would change from an int to a time.Time, and the >> deletion condition would change from being size based to being >> tim

[go-nuts] in-memory caching in golang

2021-12-09 Thread Rakesh K R
Hi, In my application I have this necessity of looking into DBs to get the data(read intensive application) so I am planning to store these data in-memory with some ttl for expiry. Can someone suggest some in-memory caching libraries with better performance available to suit my requirement? --

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

2021-10-17 Thread K. Alex Mills
I'm guessing here, but you probably do need the full type-checker for that, depending on what you mean by "a native type". In go we can alias types in two ways. type A uint8 type B = uint8 There are subtle differences between the two which I don't claim to understand... In any case, AFAIK both a

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

2021-10-15 Thread K. Alex Mills
FWIW: I'm not surprised that it's slower because it's handling significantly more of the compilation. The parser is very fast. Adding in type-checking is going to be less fast. IIRC, the packages package also has to make network calls and do filesystem I/O behind the scenes in some cases. The pars

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

2021-10-12 Thread K. Alex Mills
It's been several months since I used these packages but IIRC, go/ast only requires code to parse correctly, while go/types actually runs the type-checker. Running the type checker implies having a complete picture of all the types used in a Go program, which, in my recollection, usually means rea

[go-nuts] Where to copy vendor to the go docker builder?

2021-09-01 Thread K Prayogo
I'm trying to make docker build faster for software that are built with golang tried to cache layer but it still slow when dependency changed since go mod download have to redownload whole dependency again and again. how to make use vendor directory on docker build? (where to copy? so go build

Re: [go-nuts] HTTP request reading

2021-04-29 Thread K. Alex Mills
Partial responses inline, HTH. On Thu, Apr 29, 2021, 6:09 AM Amit Saha wrote: > Hi all, when an incoming request comes in, does the ListenAndServe() > function read the first line (as explained in > https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages) to figure > out whether there is a ha

Re: [go-nuts] go text://protocol client?

2021-04-11 Thread K. Alex Mills
On Sun, Apr 11, 2021, 5:15 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > On Sun, Apr 11, 2021 at 5:11 AM Kurtis Rader wrote: > >> >> It is nice that the specification allows for an efficient implementation. >> But I agree with Dan that your documentation is opaque, obtuse,

Re: [go-nuts] Update to generics proposal

2021-04-04 Thread K. Alex Mills
This seems like a welcome change and leaves the door open for the future inclusion of type unions. Nicely done! Regarding this approximation operator, I have a question about the intended meaning of: ~struct{ F int A string } Would this match the following types? type A struct{ F int A

Re: [go-nuts] WMI and Go... where to get started?

2021-02-08 Thread Aravindhan K
Hi, I don't think there exists WMI client implementation in Go. You could try cgo with samba WMI implementation https://github.com/greenbone/openvas-smb Thanks, Aravindhan K On Mon, Feb 8, 2021, 1:49 AM Tom Limoncelli wrote: > I've been using Unix for decades (and Go since the

[go-nuts] Re: Type-checking from Memory?

2021-01-23 Thread K. Alex Mills
ware the loader package predates Go modules, so this approach may miss something important for some use-cases. For my purposes, I want to avoid downloading / type-check module dependencies anyway. Sincerely, K. Alex Mills On Wed, Jan 20, 2021 at 8:03 PM K. Alex Mills wrote: > Hi All, &g

[go-nuts] Type-checking from Memory?

2021-01-20 Thread K. Alex Mills
packages without reinventing a large part of what packages provides? Thanks, K. Alex Mills -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+u

Re: [go-nuts] Thread safe tree library?

2021-01-08 Thread K. Alex Mills
> I was thinking of potential issues if you rebalance the tree as an example. > > I’m not certain what issues could arise as I’ve never considered a > concurrent data structure that lacks some kind of synchronisation for both > read and writes unless it’s immutable copy-on-write or similar. > > Do

Re: [go-nuts] Thread safe tree library?

2021-01-05 Thread K. Alex Mills
On Tue, Jan 5, 2021, 6:59 PM Nathan Fisher wrote: > Does write only locking provide read correctness? I would’ve thought based > on the memory model it could cause issues? > > https://golang.org/ref/mem#tmp_2 > It depends on your notion of "read correctness", specifically when you consider each

Re: [go-nuts] Thread safe tree library?

2021-01-05 Thread K. Alex Mills
That is the simplest and most conservative way go about it, but ultimately it depends on what you need out of your concurrency semantics. If you're willing to settle for a linearizable execution, you can gain some performance improvements by only checking the lock for write operations. So long as

Re: [go-nuts] Re: The GitHub Vet Project

2021-01-01 Thread K. Alex Mills
> Technically, I believe a range loop variable can be used in a goroutine >> safely. A very contrived example: https://play.golang.org/p/jgZbGg_XP6S . >> In practice I can not see much use for this kind of pattern, but it does >> exist. >> > > It is correct that the range loop variable can be used

Re: [go-nuts] Signature Switch - third path to Go generics

2020-12-31 Thread K. Alex Mills
At a glance, this feels to me like it is more complicated than the current generics proposal. That said, it also seems very original so I have to give credit there. This proposal seems to put the responsibility for monomorphizing generic code onto the programmer. I'm not sure why it would be simpl

Re: [go-nuts] The GitHub Vet Project

2020-12-30 Thread K. Alex Mills
-loop pointer. Tim King has just pointed out a few other concerns like pointer comparison and finalizers for which analyzers have yet to be written. My perception is that these two features aren't very widely used, so I wouldn't expect to find a large number of instances like these.

Re: [go-nuts] Re: The GitHub Vet Project

2020-12-30 Thread K. Alex Mills
> It's worth mentioning that there are issues which loopclosure misses >> which VetBot is able to find, and the community's effort will still be >> needed to help sift through false-positives once the project has stabilized. >> >> >> On Sun, Dec 20, 2020 at 12:0

[go-nuts] Re: The GitHub Vet Project

2020-12-29 Thread K. Alex Mills
s which loopclosure misses which VetBot is able to find, and the community's effort will still be needed to help sift through false-positives once the project has stabilized. On Sun, Dec 20, 2020 at 12:08 PM K. Alex Mills wrote: > Hello Gophers! > > During a Q&A session at t

Re: [go-nuts] [generics] Print[T Stringer](s []T) vs Print(s []Stringer)

2020-12-27 Thread K. Alex Mills
n can have significant performance > implications for low-level/tight-loop functions as it will avoid the > indirection required for interface method dispatching (at the expensive of > code explosion for common calls with lots of types). > > On Dec 27, 2020, at 11:31 AM, K. Alex Mi

Re: [go-nuts] Re: [generics] Print[T Stringer](s []T) vs Print(s []Stringer)

2020-12-27 Thread K. Alex Mills
ck the whole thing as far as I am concerned. > > Cheers > > On Sun, 27 Dec 2020, 05:25 K. Alex Mills, wrote: > >> While it depends on the final generics implementation, my understanding >> of how things stand now is that Print would compile down to a separate >> chun

Re: [go-nuts] Re: [generics] Print[T Stringer](s []T) vs Print(s []Stringer)

2020-12-26 Thread K. Alex Mills
While it depends on the final generics implementation, my understanding of how things stand now is that Print would compile down to a separate chunk of binary for each type T that is used. For instance, if you used Print[A] and Print[B] in your code, they would each refer to separate binary impleme

[go-nuts] [generics] go2go snippets -- repository of example solutions to problems using generics

2020-12-24 Thread K. Alex Mills
For my part, I see some value in maintaining a source of example solutions to problems that generics could solve. Since I was not aware of any resource that attempts to gather together several example implementations in one place (and couldn't find one after a couple minutes of searching), I decide

Re: [go-nuts] Generics - please provide real life problems

2020-12-24 Thread K. Alex Mills
On Thu, Dec 24, 2020, 1:18 AM Martin Hanson wrote: > I'm sorry, but this is not real life problems. This is exactly the problem > with this proposal. It's based on nothing but small theoretical examples. > Sorry, I don't understand. Here are some of the example applications which Ian mentions i

Re: [go-nuts] Re: Generics, please go away!

2020-12-23 Thread K. Alex Mills
On Wed, Dec 23, 2020, 6:17 AM Martin Hanson wrote: > > After generics gets added, it's going to be something else next time, and > again and again. The list goes on and on about changes people want to > make to Go. Not real life problems, just so-called "nice to have". > > No, the added and incre

Re: [go-nuts] The GitHub Vet Project

2020-12-21 Thread K. Alex Mills
On Sun, Dec 20, 2020, 2:01 PM Jan Mercl <0xj...@gmail.com> wrote: > > I expressed my concerns at the issue tracker in 2017 when I still had > a Github account. That's no more the case, so I'll take the > opportunity to make a comment here. I still believe that the intent to > change the behavior t

[go-nuts] The GitHub Vet Project

2020-12-20 Thread K. Alex Mills
ct line 'GitHub Vet Expert' and include your GitHub username and a brief outline of your experience with Go. It's my hope that this project can provide some data that can help to move Go forward. To that end, I'm also interested in any and all feedback and suggestions. Co

Re: [go-nuts] Any embedded scripting language for Go

2020-10-21 Thread Aravindhan K
Thanks for the suggestions, I will check it out. Go as interpreted language seems an interesting idea, I will surely try that. https://goplay.space#draw wonderful idea! to teach programming to kids. Thanks, Aravindhan K On Wed, Oct 21, 2020 at 11:48 PM Wojciech S. Czarnecki wrote: > D

[go-nuts] Any embedded scripting language for Go

2020-10-20 Thread Aravindhan K
bindings to arbiratory go packages back and forth? and I could embed it in Go App as well. Thanks, Aravindhan K -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an

[go-nuts] more simple modules usage questions

2020-08-19 Thread &#x27;K Richard Pixley' via golang-nuts
I have two local git repositories.  Both are go modules.  Call them, foo.com/one and foo.com/two.  Both have go.mod files declaring themselves to be, respectively, foo.com/one and foo.com/two based on go 1.15. I want to use a package from one in the other. import "foo.com/one/pkg/thing1"

Re: [go-nuts] Re: module confusion

2020-08-17 Thread &#x27;K Richard Pixley' via golang-nuts
On 8/17/20 08:41, fge...@gmail.com wrote: On 8/17/20, 'K Richard Pixley' via golang-nuts wrote: On 8/15/20 00:43, fge...@gmail.com wrote: On 8/15/20, Marvin Renich wrote: * Volker Dobler [200814 14:53]: On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: Isn&

Re: [go-nuts] Re: module confusion

2020-08-17 Thread &#x27;K Richard Pixley' via golang-nuts
On 8/15/20 00:43, fge...@gmail.com wrote: On 8/15/20, Marvin Renich wrote: * Volker Dobler [200814 14:53]: On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: Isn't this the default location? I just untarred the distribution... No. There is a reason https://urldefens

Re: [go-nuts] Re: module confusion

2020-08-14 Thread &#x27;K Richard Pixley' via golang-nuts
On 8/14/20 11:54, 'Carla Pfaff' via golang-nuts wrote: People and installers usually install Go in /usr/local/go on Unix-like systems. ~/go is the default GOPATH if not set, so ~/go/bin is where binaries installed via "go get" / "go install" land. But the Go distribution itself must not be un

Re: [go-nuts] Re: module confusion

2020-08-14 Thread &#x27;K Richard Pixley' via golang-nuts
On 8/14/20 11:27, 'Carla Pfaff' via golang-nuts wrote: This has nothing to do with modules. You're still using the old GOPATH mode, because you're not in a directory with a go.mod file. GOPATH defaults to $HOME/go when it's not set (since 1.8), but that's where you chose to put your Go installa

Re: [go-nuts] module confusion

2020-08-14 Thread &#x27;K Richard Pixley' via golang-nuts
On 8/14/20 11:20, Jan Mercl wrote: [External Email. Be cautious of content] On Fri, Aug 14, 2020 at 8:03 PM 'K Richard Pixley' via golang-nuts wrote: What am I missing? package github.com/mna/pigeon: cannot download, $GOPATH must not be set to $GOROOT. For more details see: '

[go-nuts] module confusion

2020-08-14 Thread &#x27;K Richard Pixley' via golang-nuts
I'm consistently finding modules confusing. Here's today's confusion.  I /think/ I've eliminated local environment settings but, once done, go get isn't working and I don't understand what needs to be changed.  What am I missing? kpixley@editsb> type go -bash: type: go: not found kpixley@edit

Re: [go-nuts] errors in generated go files

2020-07-28 Thread &#x27;K Richard Pixley' via golang-nuts
-gk!SlX7HXyBDsi3JH4W9wJK6Fot9ltqulcQ3vK1SsKXdK8vOv8IKWkfnlQMBFNMg5X6-w$> On Tue, Jul 28, 2020 at 8:35 PM 'K Richard Pixley' via golang-nuts mailto:golang-nuts@googlegroups.com>> wrote: I'm currently working with pigeon, a peg based parser generator. When I... * make a go error in t

[go-nuts] errors in generated go files

2020-07-28 Thread &#x27;K Richard Pixley' via golang-nuts
I'm currently working with pigeon, a peg based parser generator. When I... * make a go error in the source file, grammar.peg... * that is processed correctly by pigeon into an invalid grammar.go... * and the go compiler correctly complains about the error... * it complains about an error in

Re: [go-nuts] Re: module questions

2020-07-22 Thread &#x27;K Richard Pixley' via golang-nuts
/__https://golang.org/cmd/go/*hdr-Module_configuration_for_non_public_modules__;Iw!!NEt6yMaO-gk!QHXTYzfPrz9VAadiq_48v7YOHbjoDxRuZNfdsXYf7A5CZ0Gm5NEexxiuSt4UPUnBUA$> On Monday, 20 July 2020 20:40:19 UTC+1, K Richard Pixley wrote: I'm think I understand the go-1.14 downloadable module workf

[go-nuts] module questions

2020-07-20 Thread &#x27;K Richard Pixley' via golang-nuts
I'm think I understand the go-1.14 downloadable module workflow. But I'm not getting how to use modules in an enterprise system where we cannot allow automated downloads or where I want to include packages from one local module in another where neither are available on any public download serve

Re: [go-nuts] Generics and parentheses

2020-07-19 Thread K Davidson
as `reset!`, or ? for boolean return values, like `iszero?`) Not to mention most of us already overload our keys nowdays anyways; I have yet to see a keyboard with a leader key ;] -k -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

[go-nuts] class is invalid in multicast dns record for srv and txt

2020-06-28 Thread Rakesh K R
Hi, I am using gopacket for parsing mDNS packet. following things are missing in the decode logic of mDNS packets: 1. cache flush field is not present in DNSResourceRecord struct 2. cache flush bit and class is combine as Class struct member. Due to point 2, Class variable will be getting invalid

Re: [go-nuts] Is it necessary to start function names within main package with capitalized letter?

2020-06-24 Thread &#x27;K Richard Pixley' via golang-nuts
I generally do the reverse. Everything is internal, lower case, until and unless I need it elsewhere.  Then I reevaluate where the boundaries should be at that time. I often find that as an exported API, I need/want different things out of it than I did when it was internal. -- You received

Re: [go-nuts] Re: go get golang.org/dl/go1.14.4 ?

2020-06-19 Thread &#x27;K Richard Pixley' via golang-nuts
Bah.  No, of course not.  Never use it. Thank you. On 6/19/20 12:37 AM, Brian Candler wrote: ~/go/bin is not in your $PATH ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send

[go-nuts] go get golang.org/dl/go1.14.4 ?

2020-06-18 Thread &#x27;K Richard Pixley' via golang-nuts
I must be missing something.  Could someone please point me? kpixley@kpixley-mbp> go version go version go1.14.4 darwin/amd64 kpixley@kpixley-mbp> go get golang.org/dl/go1.14.4 kpixley@kpixley-mbp> type go1.14.4 bash: type: go1.14.4: not found kpixley@kpixley-mbp> go get golang.org/dl/go1.13.12 k

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread K Richard Pixley
On 6/16/20 09:04, 'Thomas Bushnell, BSG' via golang-nuts wrote: On Tue, Jun 16, 2020 at 11:51 AM 'K Richard Pixley' via golang-nuts mailto:golang-nuts@googlegroups.com>> wrote: I do not agree with the Rust team.  I would prefer to make my technology decisi

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread &#x27;K Richard Pixley' via golang-nuts
On 6/16/20 5:00 AM, Russ Cox wrote: ...I will quote from the Code of Conduct here – “regardless of gender identity and expression, sexual orientation, disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality, race, age, religion, or similar personal characteristics.”

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread K Davidson
This mailing list is for the Go Programming Language, there are other places on the internet to discuss unrelated topics. Please keep posts limited to things about go. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

Re: [go-nuts] Re: What's the best IDE for golang?

2020-05-28 Thread Bhaskar K
How about vim + vim-go ? On Fri, May 29, 2020 at 8:02 AM Richard Masci wrote: > Yep you got that right. Best IDE hands sown is Goland, second is vscode. > At least In my opinion. I personally write all in vscode, goland is too > expensive for someone who is not

Re: [go-nuts] Packet parsing in Go

2020-04-21 Thread Rakesh K R
at 11:44 PM, Jan Mercl <0xj...@gmail.com> wrote: > On Tue, Apr 21, 2020 at 6:08 PM Rakesh K R wrote: > > > In C, we used to typecast this array of uint8_t to predefined structure. > > Go has no casts. Regardless, one can do something similar using > unsafe. But then

[go-nuts] Packet parsing in Go

2020-04-21 Thread Rakesh K R
Hi, I am new to Go and I am trying to parse the network packets received. In C, we used to typecast this array of uint8_t to predefined structure. Is there a way I can do this similarly in Go? or any better approach to do this in Go? i.e. I need to parse the packet to store them to respective l2/

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-13 Thread &#x27;K Richard Pixley' via golang-nuts
If they end up "littering", then I'll agree.  So far, I just need the one... hold my beer... On 4/13/20 10:40 AM, Robert Engels wrote: I don’t think littering your code with state variable and branches just to test is in anyway a good (or sustainable approach) approach.  I have never seen any

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-13 Thread &#x27;K Richard Pixley' via golang-nuts
On 4/10/20 4:15 PM, Ian Lance Taylor wrote: I'm not proud. Here is an example program for which os.Open(dirname) succeeds but ioutil.ReadDir(dirname) fails. You may have to adjust pathMax and nameMax for your system. Whether you actually want to use this technique is left to you. Thank you. 

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-13 Thread &#x27;K Richard Pixley' via golang-nuts
I like this solution better than Ian's, thank you. If I can't eliminate an error, or fake it, add a new one.  :). On 4/12/20 4:04 PM, Rob Pike wrote: I am the author of the test coverage tool, and I do not believe that 100% code coverage is the right goal. Coverage is a proxy for testing quali

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-13 Thread &#x27;K Richard Pixley' via golang-nuts
On 4/12/20 6:55 AM, Kevin Malachowski wrote: [External Email. Be cautious of content] Is there a particular reason you want 100% code coverage? In this case, I'm writing code that will be the introduction of go to a team of which I am now a fresh member.  100% code coverage opens eyes.  And

[go-nuts] testing code that uses ioutil.ReadDir?

2020-04-10 Thread &#x27;K Richard Pixley' via golang-nuts
I have some code.  It uses ioutil.ReadDir which returns a possible error. My testing is at 99% code coverage because I can't figure out a way to set up a situation in which os.Open succeeds on a directory, but ioutil.ReadDir fails. I can get to 100% code coverage if I throw away the err rathe

Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Aravindhan K
Thanks Ian. Aravindhan K On Thu, Apr 9, 2020 at 3:21 AM Ian Lance Taylor wrote: > On Wed, Apr 8, 2020 at 10:19 AM Aravindhan K > wrote: > > > > If that is the case, in below code main go routine will a reach a > situation where no other go routines running to wake it up

Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Aravindhan K
elect{}, doesn't the coder purposely wishes to block forever? Thanks, Aravindhan K On Wed, Apr 8, 2020 at 10:13 PM 'Vikram Ingawale' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi Manlio , > > The select statement will block until one of its cases is

[go-nuts] Distributing task execution

2019-08-09 Thread Thiru k
Hi, We have used goLang for developing the web based application using micro service pattern. Each and every service will be scale as per demand. here, few of the functionality have to be worked periodically as *cron* , it is easy on the server is just one but if it is scaled then the problem ar

[go-nuts] 【Go Specification fix proposal】about ConstSpec = IdentifierList [ [ Type ] "=" ExpressionList ] .

2019-05-31 Thread k . kubo . private . mobile
In Go Language Specification, I saw the definition of const. https://golang.org/ref/spec#Constant_declarations ConstDecl = "const" ( ConstSpec | "(" { ConstSpec ";" } ")" ) .ConstSpec = IdentifierList

[go-nuts] Re: Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-23 Thread K Davidson
Since this is a mailing list, not sure if my comment could be deleted. If not, please disreguard my reply, it was a case of unchecked presumptions meets foot-in-mouth-disease ;/ Thanks, -K -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Re: Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-23 Thread K Davidson
g against needs to be on the right. Like: err = incrval.SetValStr(tptoken, errstr, &incr) if err != nil { panic(fmt.Sprintf("YDB: Unexpected error with SetValStr(): %s", err)) } } It may be helpful to take a look at https://golang.org/ref/spec. Best of luck, -K -- You

[go-nuts] Re: Persistence of value, or Safely close what you expected

2019-03-13 Thread K Davidson
You may have to copy-paste the playground link as clicking appears to load a previous version of the message that I deleted. (Not sure if this is just a bug on my end) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

[go-nuts] Re: Persistence of value, or Safely close what you expected

2019-03-13 Thread K Davidson
Hi, Just wanted to put it out there, that one way of handling a situation where you try to close on a chanel which may already be closed is to catch the panic with a recover like so: https://play.golang.org/p/nEeZ6ddXRR_O <https://play.golang.org/p/8uRq8J2TH2i> -K -- You receive

[go-nuts] Re: Persistence of value, or Safely close what you expected

2019-03-13 Thread K Davidson
Hi, Just wanted to put it out there, that one way of handling a situation where you try to close on a chanel which may already be closed is to catch the panic with a recover like so: https://play.golang.org/p/8uRq8J2TH2i -K -- You received this message because you are subscribed to the

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

2019-01-08 Thread K Davidson
You could also do: https://play.golang.org/p/zjNVeQNbCq5 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more option

[go-nuts] Re: C++ 11 to Golang convertor

2019-01-07 Thread K Davidson
My original comment was in regaurd to c++11, but seeing as the discussion has drifted towards c, you may want to take a look at https://github.com/xlab/c-for-go, it is based off of its based off of https://github.com/cznic/cc, and has been used to create go bindings for portaudio, libvpx, and a few

[go-nuts] Re: C++ 11 to Golang convertor

2019-01-03 Thread K Davidson
I read somewhere that you can do some of the needed work using swig++, but like others have said, I don't think it would produce perfectly ported idiomatic code out of the box... -kdd -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

[go-nuts] Re: A single type to wrap text/template.Template and html/template.Template

2018-12-31 Thread K Davidson
ut. type CsvTemplate struct { template.Template t txt.Template } -K - show quoted text - On Monday, December 31, 2018 at 1:51:34 PM UTC-7, Renee Jylkka wrote: > > Hello, > > The project that I am working on is a web app written on a custom web > server using Go and Go templates.

[go-nuts] Re: A single type to wrap text/template.Template and html/template.Template

2018-12-31 Thread K Davidson
for CSV output. type CsvTemplate struct { template.Template t txt.Template } -K On Monday, December 31, 2018 at 1:51:34 PM UTC-7, Renee Jylkka wrote: > > Hello, > > The project that I am working on is a web app written on a custom web > server using Go and Go templates. I sto

[go-nuts] Re: A single type to wrap text/template.Template and html/template.Template

2018-12-31 Thread K Davidson
One way to accomplish this may be to use embedding to wrap both Templates into a new type: package main import ( txt "text/template" "html/template" ) // CsvTemplate wraps a html/template.Template and adds a text/template.Template // field for CSV output. type CsvTemplate struct {

[go-nuts] Re: Constraints for generics

2018-09-30 Thread K Davidson
Hi, Just a couple of friendly notes / impressions: I couldn't help but notice how many new gramars, or additions would need to be added to the language in order to support a feature aiming to be simple, in a language where one of the top driving goals it to be as simple as possible. Also no bui

[go-nuts] Re: Are C allocated memory completely isolated to Go memory in any cases?

2018-09-29 Thread K Davidson
Not sure if it would be of any help, but maybe you can gleem some insight from the way these packages did things? https://github.com/mattn/go-gtk https://github.com/gotk3/gotk3 -K -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

[go-nuts] Re: Binary module and security reasons

2018-09-18 Thread K Davidson
Have you seen cgo? (more here and some examples ) On Friday, September 14, 2018 at 7:39:35 AM UTC-7, Vitold S wrote: > > Hello my friends, > > Right now I review go ui module ( https://github.com/andl

  1   2   >