Re: [go-nuts] Why Go has only slice and map

2022-04-12 Thread Tyler Compton
Interestingly, Go also kind of has a built-in set data type by using map keys! https://go.dev/play/p/3-ZEKPSPUEh I know that's not really what you mean, but I think it's a cool pattern. On Tue Apr 12, 2022, 07:50 PM GMT, Ian Lance Taylor wrote: On Mon, Apr 11, 2022 at 11:19 PM 'Jack Li' via

Re: [go-nuts] Whats wrong with my builder pattern

2021-12-05 Thread Tyler Compton
It's because your method receivers are values, not pointers: func (b Builder) setFirst() { b.firstElement = "First element" } In Go, method receivers work a lot like regular function arguments. When you call the above method, you're operating on a copy of the Builder struct. Any time you

Re: [go-nuts] Parse JSON case-sensitively

2021-09-23 Thread Tyler Compton
Hi Aaron, I'm not aware of a JSON library that fits your needs, but there might be an XY Problem going on here. What problem are you having trouble solving with encoding/json that lead you to this solution? On Thu, Sep 23, 2021 at 11:23 AM 'Aaron' via golang-nuts <

[go-nuts] Should "go install module@version" interact with ~/.local/bin?

2021-07-13 Thread Tyler Compton
With recent changes to go install, we now have an official, module-aware way to locally build and install Go tools. This is a great step, but I wonder if some renewed consideration should be made to where the tools are installed. As I'm sure you all know, go install puts binaries in $GOPATH/bin

Re: [go-nuts] doubts

2021-07-10 Thread Tyler Compton
It's not clear to me exactly where you're getting stuck. It seems like you have a reasonable understanding of what you need to do. Could you add some information on what you've tried so far and where you're getting stuck? On Sat, Jul 10, 2021 at 10:38 AM Sree lekshmi MG wrote: > hey all i am

Re: [go-nuts] UML && Golang, part 2 ?

2021-07-04 Thread Tyler Compton
Is it true that UML is unpopular? I don't think you'll catch many gophers writing class diagrams, but I've found higher level UML diagrams useful. That said, I find UML somewhat overspecified for day-to-day use. A simple block diagram is often enough for me to explain something to a coworker or

Re: [go-nuts] golang/mobile: Could we add GitHub Actions for PRs?

2021-03-24 Thread Tyler Compton
I'm not a go-mobile contributor, but since the repository is only mirrored on GitHub and hosted elsewhere I'm not sure if GitHub Actions would be the right choice. I think they'd reach a CI tool that can have its results appear both on GitHub and on googlesource.com. On Mon, Mar 22, 2021 at 8:48

Re: [go-nuts] A message from the CoC committee

2021-03-24 Thread Tyler Compton
Thanks Carmen, and others on the CoC committee. I don't think anyone would say the work you do is fun, but whenever we get these rashes of toxic behavior on the mailing list or on GitHub, it makes me glad the CoC exists. On Tue, Mar 23, 2021 at 7:01 AM 'can...@google.com' via golang-nuts <

Re: [go-nuts] No generic, part -2

2021-03-19 Thread Tyler Compton
eryone was aware of who stands behind the project, > it would be correct to say "a group of Google employees". > 2. Sure, Ian has revealed how that "consensus" was measured. By counting > "thumbs up", "thumbs down" and "confused" emojis.

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Tyler Compton
I think we all want to stick our noses in this thread. I'm going to stick my nose in it too :) Space, I don't think you'll ever be happy as a result of this discussion, no matter what evidence or arguments others provide you. I think the fact is that you were burned by the outcome of the generics

Re: [go-nuts] No generic, part -2

2021-03-12 Thread Tyler Compton
I would also add that there was an old generics design draft based around contracts [1] that was not accepted for multiple reasons, but one was that it wasn't clear how the implementation could actually work. This suggests that implementation issues are definitely considered during the proposal

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-04 Thread Tyler Compton
You could imagine a `slices` standard library package that has a regular generic function called `slices.Remove` that removes one or a series of elements. This seems like a smart addition to me, as the current de-facto method isn't very expressive. I imagine this didn't exist before because adding

Re: [go-nuts] R.I.P. Michael Jones

2021-02-04 Thread Tyler Compton
Thank you Jan for posting this. From his incredible accomplishments to his day-to-day friendliness and insight on this mailing list, he will certainly be missed. On Thu, Feb 4, 2021 at 3:13 PM Jan Mercl <0xj...@gmail.com> wrote: > >

Re: [go-nuts] Gopls enabled by default in VSCode

2021-02-01 Thread Tyler Compton
I can't find the announcement off hand, but I remember gopls being announced as stable at least a few months ago. Like Brian, I think this documentation needs to be updated. Anecdotally, I was around and using gopls back when it was definitely not stable. It's gotten leagues better and now I have

Re: [go-nuts] [ANN] New Go package: xmorph

2021-01-18 Thread Tyler Compton
That GIF makes me very happy. It reminds me of the Animorphs book covers made with Elastic Reality :) On Mon, Jan 18, 2021 at 12:24 PM Scott Pakin wrote: > It's perhaps a bit of a niche tool, but I just released *xmorph*, a > package for warping and morphing images. The code is available from

Re: [go-nuts] an open source project to replace SMTP/email

2021-01-08 Thread Tyler Compton
Seems cool Liam, thanks for sharing! On Tue, Jan 5, 2021 at 2:30 PM Liam wrote: > > The mnm project is building a legitimate email replacement: a client[1], a > server[2], and a simple protocol[3] between them. (Legitimate, i.e. > n-identity, decentralized, store-and-forward, open protocol,

Re: [go-nuts] The GitHub Vet Project

2020-12-30 Thread Tyler Compton
M K. Alex Mills wrote: > On Wed, Dec 30, 2020, 10:34 PM Tyler Compton wrote: > >> This is a very interesting project! I went ahead and labeled a few of the >> issues. However, much as I hate to pour cold water on the idea, I have some >> doubts about how effective this

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

2020-12-30 Thread Tyler Compton
Space A, > So switching from subject to my personality and telling me what I should > and what shouldn't, to whom to listen, and what to read is something in > line with "code of conduct" which you appeal as the argument of last resort? > I've seen how you carry yourself on this list, and you

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

2020-12-30 Thread Tyler Compton
Hi Martin, You've been very willing in this thread to listen to feedback, and I appreciate that. I hope it doesn't feel like I'm ganging up on you, but I want to comment on one other point I disagree with in your original premise. I believe that the resilience of Go against unnecessary change is

Re: [go-nuts] The GitHub Vet Project

2020-12-30 Thread Tyler Compton
This is a very interesting project! I went ahead and labeled a few of the issues. However, much as I hate to pour cold water on the idea, I have some doubts about how effective this approach can be. The githubvet bot has reported over ten thousand issues so far, which is quite a lot. My gut

Re: [go-nuts] Re: Garbage Collector triggering when deleting an object

2020-11-24 Thread Tyler Compton
If you're using finalizers to clean up C memory, it's important to know that the Go garbage collector has no understanding of how much C memory a given resource holds. This prevents the garbage collector from making smart decisions about when to release your resources. I've never personally seen

Re: [go-nuts] Is it possible that a hybrid memory management could be implemented?

2020-11-15 Thread Tyler Compton
I may be misunderstanding what you're suggesting, but I believe Go already tries to detect when a value can be placed on the stack. Then, it will be freed automatically when it falls out of scope. On Sun, Nov 15, 2020 at 5:20 PM tapi...@gmail.com wrote: > > For example, some local memory

Re: [go-nuts] Proposal: New keyword returnif (resolves error handling)

2020-11-10 Thread Tyler Compton
Some thoughts: The "try proposal" and some others identified and solved two problems: a. The verbosity of using a full if statement to check error values b. The verbosity of applying wrapping and other error handling logic to every place where an error is returned This proposal only addresses

Re: [go-nuts] A Big Thank You to the Contributors of pkg.go.dev

2020-11-10 Thread Tyler Compton
Agreed! There was a lot of negativity surrounding pkg.go.dev regarding license detection and the original decision for it to be closed source (which was revised). These are all valid critiques, but they unfortunately overshadowed how great an experience pkg.go.dev is. Thanks to everyone who is

Re: [go-nuts] go list "go:generate" files

2020-11-09 Thread Tyler Compton
I know that you're asking about how to do this with the standard tools, but you can do this with grep if you're on a platform that has the command available: grep --recursive --files-with-matches "//go:generate" or, for short: grep -rl "//go:generate" This command will output a list of files

Re: [go-nuts] Syntactic Sugar Idea for Go 2.0: until/unless, and postfix conditionals

2020-11-02 Thread Tyler Compton
greatly simplifies the thinking about what is going > to happen in a section of code. > > On Mon, 2020-11-02 at 21:22 -0800, Tyler Compton wrote: > > I don't think I'm personally sold on this proposal either, but I'm > > curious what bad experiences you've had with post-fi

Re: [go-nuts] Syntactic Sugar Idea for Go 2.0: until/unless, and postfix conditionals

2020-11-02 Thread Tyler Compton
I don't think I'm personally sold on this proposal either, but I'm curious what bad experiences you've had with post-fix conditionals. I haven't personally used a language with post-fix conditionals and it sounds like that might be to my benefit :) On Mon, Nov 2, 2020 at 9:09 PM 'Dan Kortschak'

Re: [go-nuts] Re: Command line tool to modify YAML files

2020-11-02 Thread Tyler Compton
> > I saw yq but it seemed like it was written in python, which I have no time > for. > You're going to be limiting your tooling options quite a bit in that case :) On Mon, Nov 2, 2020 at 8:49 AM alex breadman wrote: > Thanks for the reply. > > I just did it for fun actually, and for the

Re: [go-nuts] Go is easy to lean. But other languages are hard to forget

2020-10-04 Thread Tyler Compton
I wonder if mailing lists for all languages get posts like this :) Working in Go is great, but every language has sharp corners. Language design is a tricky balancing act of trade-offs, and I don't think Go or any other language is above that. On Sun, Oct 4, 2020 at 1:25 PM Amnon wrote: > Go is

Re: [go-nuts] [ANN] CGo-free sqlite database/sql driver 1.4.0 for linux/amd64 released

2020-08-28 Thread Tyler Compton
Thanks Jan, this is very exciting! I'm looking forward to an opportunity to use this. On Wed, Aug 26, 2020 at 2:51 PM Jan Mercl <0xj...@gmail.com> wrote: > From the change log (https://godoc.org/modernc.org/sqlite#hdr-Changelog) > > 2020-08-26 v1.4.0: > > First stable release for linux/amd64.

Re: [go-nuts] A few thoughts on type parameters

2020-08-05 Thread Tyler Compton
On Wed, Aug 5, 2020 at 1:07 AM Jan Mercl <0xj...@gmail.com> wrote: > It's not supposed to be anything special whatsoever. Just like number > zero or an empty set is not some kind of an exception. It's just you > cannot have any reasonable set theory without it. > I think it's fair to say that

Re: [go-nuts] Calling methods from inside a function in same package

2020-07-21 Thread Tyler Compton
I think I'm very likely misunderstanding your question. Would you mind providing more detail? You can definitely call methods within a function, even if they're defined in the same package. In this example, I call a method from the type "myInt" in the main function:

Re: [go-nuts] Go 2 review process

2020-07-19 Thread Tyler Compton
I had forgotten about the multidimensional slices proposal. That's a very good counter-example. On Sun, Jul 19, 2020 at 4:12 AM Ian Davis wrote: > On Sun, 19 Jul 2020, at 2:08 AM, Ian Lance Taylor wrote: > > On Sat, Jul 18, 2020 at 12:19 AM Tyler Compton > wrote: > > >

Re: [go-nuts] Go 2 review process

2020-07-18 Thread Tyler Compton
I'm beginning to think that community members (like myself) can't reasonably be expected to put in the necessary effort to champion a sizable language change. I think it was Ian who made multiple generics draft proposals just to reject them himself, then Ian and Robert Griesemer spent more untold

Re: [go-nuts] the go archive size must be smaller?

2020-07-16 Thread Tyler Compton
I think something unfortunate happened to your diagram. On Gmail, I see an tag with a huge amount of base64 encoded text, and on Google Groups I don't see anything at all. It may work better to upload the image to a hosting service like Imgur and link to it. On Thu, Jul 16, 2020 at 9:47 AM

Re: [go-nuts] [generics] Syntax feedback

2020-06-30 Thread Tyler Compton
fSnH0w1G0/JbMkJrKICAAJ for > an additional item for your list? > > Thank you very much, > Andrey > > On Saturday, June 27, 2020 at 11:46:23 AM UTC-6, Tyler Compton wrote: >> >> Hi Rob, >> >> This topic has been discussed many times on this list, so it's probably

Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread Tyler Compton
Hi Rob, This topic has been discussed many times on this list, so it's probably best to look at and post in one of those threads. Let me take this chance to collect as much information about this issue as I can in a single post. Unfortunately, discoverability can sometimes be hard on mailing

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread Tyler Compton
On Fri, Jun 26, 2020 at 10:52 AM David Riley wrote: > Also, to this specific point: this exact approach, as with much of Go, > embodies the Bell Labs approach to design (for better or for worse, and > with good reason). Sometimes we have to live with the artifacts of > evolution. > One

Re: [go-nuts] How I can translate this shell command to golang code?

2020-06-22 Thread Tyler Compton
I just want to highlight an easy mistake to make here. One might expect to be able to run something like this: exec.Command("echo", "-n", "123456", "|", "dmtxwrite", "-s", "16x48", "-o", "image.png") But, as you might have found, this doesn't work. This is because the pipe "|" is an operator

Re: [go-nuts] Re: [generics] I think it's better have higher perfomance than lower compiling time

2020-06-20 Thread Tyler Compton
The idea of having development and release compilation modes sounds appealing at first, though I'm a bit skeptical about how it would turn out. This would mean that, during development, you wouldn't have a full understanding of the performance characteristics of your program. Admittedly, that's

Re: [go-nuts] Go has confusing pointers

2020-06-19 Thread Tyler Compton
> > c is of type *Count (pointer to Count), surely? > Yes, my mistake! Thank you for the correction. -- 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

Re: [go-nuts] Go has confusing pointers

2020-06-19 Thread Tyler Compton
> > *c = *c + 1 //why use *c and not just c, based on (c *Count) c is already > a pointer? > In Go (as well as other languages like C) '*' plays two roles. When used with a type like in "c *Count", it tells you that c is a pointer to a Count object. When used on a variable, like "*c + 1", it

Re: [go-nuts] [generics] Simplification: Methods refer to original type parameters instead of re-specifying each time

2020-06-17 Thread Tyler Compton
I think this syntax could get confusing when embedded fields is added to the mix: type MyStruct(type T) struct { T } func (ms *MyStruct) MyMethod(t ms.T) { ms.T = t } In this example. ms.T means two very different things depending on where they are used. On Wed, Jun 17, 2020 at 3:45

Re: [go-nuts] [generics] is generics with constrain needed ?

2020-06-17 Thread Tyler Compton
The reason why implicit conversions from []Foo to []Stringer isn't supported is because Foo and Stringer have different in-memory representations. Converting from a slice of one to a slice of another would be more expensive than one would expect an implicit conversion to be. At least, this is my

Re: [go-nuts] randomly go loading modules fail

2020-05-15 Thread Tyler Compton
I saw some discussion in a previous thread indicating that Gitlab is having an incident. More details here: https://status.gitlab.com/pages/history/5b36dc6502d06804c08349f7 On Fri, May 15, 2020 at 10:04 AM msherif4 via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi : > > I have seen

Re: [go-nuts] Re: What are finalizers missing?

2020-02-18 Thread Tyler Compton
10:52 AM Jake Montgomery wrote: > On Friday, February 14, 2020 at 2:10:01 PM UTC-5, Tyler Compton wrote: >> >> The conventional wisdom I see in the Go community is to avoid using >> finalizers to manage file descriptors, C memory, or any other non-Go memory >> resour

[go-nuts] Re: What are finalizers missing?

2020-02-14 Thread Tyler Compton
I found a relevant blog post by David Crawshaw that touches on the topic of a garbage collector that can be extended to understand resources other than Go-managed memory: https://crawshaw.io/blog/tragedy-of-finalizers On Fri, Feb 14, 2020 at 11:09 AM Tyler Compton wrote: > The conventio

Re: [go-nuts] What are finalizers missing?

2020-02-14 Thread Tyler Compton
t 11:17 AM Robert Engels wrote: > > I suggest you look at PhantomReference in Java, and the Cleaner/Disposer > classes/patterns for how this would work. Go doesn't have > PhantomReferences, so it's moot at this time. > > -Original Message- > From: Tyler Compton > Sent:

[go-nuts] What are finalizers missing?

2020-02-14 Thread Tyler Compton
The conventional wisdom I see in the Go community is to avoid using finalizers to manage file descriptors, C memory, or any other non-Go memory resource. The generally accepted rationale (at least to my understanding) is that the garbage collector cannot be expected to run the finalizer promptly,

Re: [go-nuts] Why Discord is switching from Go to Rust

2020-02-07 Thread Tyler Compton
It would have been nice to see performance measurements from a more recent Go version. That said, it makes sense to me that Rust would be a better choice for this kind of application, where the main performance bottleneck is the sheer number of objects in memory. A language where you get to

Re: [go-nuts] Re: go1.12.16 not tagged on release-branch.go1.12?

2020-01-29 Thread Tyler Compton
I think it's very reasonable to ask a simple Git workflow question on golang-nuts without having to provide reproduction steps. Yes, I posted the error in reproducible form. The first step in fixing a > bug. The Go team can confirm the bug and verify that their fix works. No > guesswork required.

Re: [go-nuts] Golang and EOL of Windows 7 (Windows Server 2008)

2019-11-18 Thread Tyler Compton
As a data point, Go stopped supporting Windows XP in Go 1.10. That's 4 years after Microsoft officially ended support for the operating system. I don't think that's a hard rule, and it will probably depend on what version Go's main Windows contributors use. Relevant issue:

[go-nuts] Re: [golang-dev] go.dev is live!

2019-11-13 Thread Tyler Compton
Thanks for posting! I'm really impressed the website, and with the package view especially. I foresee myself using this instead of godoc.org from now on. I'm curious to hear more about the team's future plans for golang.org. Do you have any plans to migrate or mirror content like the blog or the

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-06 Thread Tyler Compton
> > On Nov 5, 2019, at 5:58 PM, Tyler Compton wrote: > >  > I agree with you that an original writer of the code should be expected to > know that a theoretical "contains" or "in" expression has O(n) properties. > However, I've always thought of this from t

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
at 3:58 PM Tyler Compton wrote: > I agree with you that an original writer of the code should be expected to > know that a theoretical "contains" or "in" expression has O(n) properties. > However, I've always thought of this from the perspective of someone > lookin

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
se) should make the types easily > recognizable (and understandable). > > > -Original Message- > From: Tyler Compton > Sent: Nov 5, 2019 3:57 PM > To: toddsu...@icloud.com > Cc: golang-nuts > Subject: Re: [go-nuts] Why doesn't Go include a contains method for things

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
Ian's answer addresses your question about the absence of a slice.Contains method, but there have been discussions in the past about adding such a feature to the language itself as well. You brought up the idea of a builtin "contains" function, and I've seen others suggest adding something like

Re: [go-nuts] using Go as a configuration file format

2019-09-24 Thread Tyler Compton
I do think that turing complete configuration have their place in very limited circumstances. For example, I use a window manager called Awesome WM that is configured with Lua, and that allows me to implement my own features into the WM while configuring it. The significant disadvantage here is

Re: [go-nuts] How to do a forward compatibility support for go 1.13?

2019-09-06 Thread Tyler Compton
I think that in general you will have to only use features available to Go 1.11, meaning, of course, that the new methods in the errors package would be off limits. In the mean time you could use golang.org/x/xerrors, which is a superset of the new errors package and I believe will work with 1.11.

Re: [go-nuts] [ANN] sqlc: Generate type-safe Go from SQL

2019-09-03 Thread Tyler Compton
This is very cool! It's an interesting compromise between using a fully featured ORM and interacting with SQL queries directly, and may be a good sweet spot. Have you considered supporting documentation in generated code? Maybe by allowing for syntax like this for queries: -- name: ListAuthors

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-06-29 Thread Tyler Compton
> > I wish we had a Zen of Go and followed it. > You may be interested in this: https://go-proverbs.github.io/ > > Daniela Petruzalek > Software Engineer > github.com/danicat > twitter.com/danicat83 > > > Em sáb, 29 de jun de 2019 às 20:18, Denis Cheremisov < > denis.cheremi...@gmail.com>

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-06-29 Thread Tyler Compton
Sorry, forgot to CC on my last email. Here it is again: And you must understand the specific: you are solving relatively hard > problems developing language called Go with low mistake cost and we are > solving simple problems with a DSL called Go but our mistake cost is much > higher than yours.

[go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-06-28 Thread Tyler Compton
If anyone hasn't seen it, an issue with the "proposal" tag was created earlier on the Go issue tracker titled "Proposal: leave "if err != nil" alone?" (here ). This issue seems to have resonated with a lot of people, which may be an important data point when

Re: [go-nuts] Go GTK vs QT for Linux

2019-06-18 Thread Tyler Compton
Just noticed that I mentioned the wrong package. The runtime package for GTK is libgtk-3-0. On Mon, Jun 17, 2019 at 9:48 AM Tyler Compton wrote: > I haven't personally used this library, but I'd think you'd only > need libgtk-3-dev and libappindicator3-dev at compile-time. You should be

Re: [go-nuts] Go GTK vs QT for Linux

2019-06-17 Thread Tyler Compton
I haven't personally used this library, but I'd think you'd only need libgtk-3-dev and libappindicator3-dev at compile-time. You should be able to get away with the smaller runtime packages libgtk-3-dev and libappindicator3-1 once your application is built. On Mon, Jun 17, 2019 at 6:56 AM

Re: [go-nuts] Bugs on switch

2019-06-17 Thread Tyler Compton
Andrew is right, but I'll also add that if you really do want fallthrough semantics, you can use the "fallthrough" keyword: https://play.golang.com/p/x2gBb905Hj0 Go opts to make the somewhat uncommon case of fallthrough explicit, and the more common "break" case implicit. A bit surprising for new

Re: [go-nuts] cgo libnice binding will stuck

2019-05-22 Thread Tyler Compton
Beyond just mailing list etiquette, you'll probably get better responses if you provide your code in plain text. I think that some of the more responsive people in golang-nuts use text-only email viewers, though that's only a guess! I took the liberty of transcribing this one, free of charge :)

Re: [go-nuts] Http Handler to produce static content

2019-05-20 Thread Tyler Compton
> Sorry I don't quite understand -- my go application IS my webserver. > This is a topic that has confused me in the past. In the simple case where you build a Go executable and get requests from it directly, your Go application *is* your web server. However, it's common in industry to put a

Re: [go-nuts] Re: Random panic in production with Sprintf

2019-05-02 Thread Tyler Compton
I took a quick look and yes, it uses unsafe to convert between byte slices and strings. I don't know enough to say that it's the problem but here's an example: https://github.com/valyala/fasthttp/blob/645361952477dfc16938fb2993065130ed7c02b9/bytesconv.go#L380 On Thu, May 2, 2019 at 5:16 PM Burak

Re: [go-nuts] Re: Is it possible to simplify this snippet?

2019-05-01 Thread Tyler Compton
On Wed, May 1, 2019 at 7:28 PM wrote: > if rl.IsKeyDown(rl.KeyA) { p.Rect.X-- } > if rl.IsKeyDown(rl.KeyD) { p.Rect.X++ } > if rl.IsKeyDown(rl.KeyW) { p.Rect.Y-- } > if rl.IsKeyDown(rl.KeyS) { p.Rect.Y++ } > It's worth mentioning though that this will not survive a gofmt. In general, I've

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Tyler Compton
> > There are many counter-examples. What is the likelihood that someone who > is not familiar with the "?" operator will be familiar with the operators > for getting (*) and dereferencing (&) a pointer. And what is "<-"? > Certainly people not familiar with Go will initially be confused by >

Re: [go-nuts] cracking the go language aplication

2019-04-17 Thread Tyler Compton
Could you provide some more details on what it is you want to do? Are you looking to decompile a Go executable? On Wed, Apr 17, 2019 at 12:23 PM smn shilla wrote: > Hi all > Please anyone who know to crack the go application.exe please assist me > > -- > You received this message because you

Re: [go-nuts] Question regarding gob

2019-03-26 Thread Tyler Compton
When we think of pointers as what they literally are, an address to a space in memory, it sounds reasonable for Gob to not support them. Things get more unclear when we consider that, in practice, Go programmers often use pointers as a replacement for option types. Without pointers, I don't know

Re: [go-nuts] why go get does not work outside a module?

2019-02-15 Thread Tyler Compton
It sounds to me like you would want to set GO111MODULE to "auto". My understanding is that then "go get" will behave like it used to when run inside of the GOPATH or in a directory tree without a go.mod file. Here's a bit of information about it on the wiki:

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)

Re: [go-nuts] Re: Providing more detail after a nil pointer dereference

2019-02-09 Thread Tyler Compton
Oh, and I just realized I linked completely the wrong issue. Here is a good link: https://golang.org/issues/30116 On Sat, Feb 9, 2019 at 10:31 AM Tyler Compton wrote: > > A possibly better idea would be to report the line and column number. > That should uniquely identify which co

Re: [go-nuts] Re: Providing more detail after a nil pointer dereference

2019-02-09 Thread Tyler Compton
rence with some > judicious uses of \n, if the problem is reproducible. > > On Thursday, February 7, 2019 at 4:36:01 PM UTC-8, Tyler Compton wrote: >> >> After reading https://golang.org/issues/27605 (proposal: report indexes >> for bounds failure), I started to wonder why we don't

[go-nuts] Providing more detail after a nil pointer dereference

2019-02-07 Thread Tyler Compton
After reading https://golang.org/issues/27605 (proposal: report indexes for bounds failure), I started to wonder why we don't do something similar with nil pointer dereferences. I've more than once found myself in a situation where I'm inspecting a nil pointer dereference panic and it ends up on

Re: [go-nuts] Re: multiple binaries from a single directory with go modules?

2019-01-18 Thread Tyler Compton
What alternative do you recommend? On Fri, Jan 18, 2019 at 4:53 PM Space A. wrote: > Yes/ Don't use make and makefiles. > > > >> Is there some clever way of structuring a project like this with go >> modules that I haven't figured out yet? >> >> Thanks, >> >> Tycho >> > -- > You received this

Re: [go-nuts] golang for coding interviews

2019-01-10 Thread Tyler Compton
Hi Naveen, Others may disagree but my take is that Go is not a great coding interview language. The lack of many built-in data structures is a big one, but those closing curly braces and other syntax can be a big pain when writing on a whiteboard. In cases where only general programming knowledge

Re: [go-nuts] if/switch statements as expressions

2018-12-19 Thread Tyler Compton
There is some precedent. Python has an if expression of sorts that is distinct from its if statements: print(value1 if condition else value2) And in all Lisp dialects I'm familiar with, if is an expression: (print (if condition value1 value2)) Not to say that this means Go should support it

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Tyler Compton
ng-nuts" group. > > > > To unsubscribe from this group and stop receiving emails from it, > > > > send an > > > > email to golang-nuts...@googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > > > > > &g

Re: [go-nuts] Re: different behaviour in return: error is shadowed during return

2018-11-27 Thread Tyler Compton
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 options, visit https://groups.google.com/d/optout. > -- Tyler Compton Student of Soft

Re: [go-nuts] Re: go modules and vendor: redundant features?

2018-11-21 Thread Tyler Compton
d stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Tyler Compton Student of Software Engineering Arizona State University -- You received this message because you are subscr

Re: [go-nuts] go modules and gocode

2018-11-09 Thread Tyler Compton
My understanding is the mdempsky branch is not expected to work with Go modules. This fork apparently will: https://github.com/stamblerre/gocode That said, I haven't personally had any luck with that fork either. I would love to hear from someone who's had success with gocode/vim-go/modules. On

Re: [go-nuts] Why fmt.Print() debug statements aren't showing up in dev_appserver.py logs?

2018-11-09 Thread Tyler Compton
> > log.Infof(" handleMain() called") > > The local server still serves the page correctly but the log Info is not > showing up in the dev_appserver.py logs in Terminal. > > On Thursday, November 8, 2018 at 5:57:06 PM UTC-5, Tyler Compton wrote: &g

Re: [go-nuts] Why fmt.Print() debug statements aren't showing up in dev_appserver.py logs?

2018-11-08 Thread Tyler Compton
I believe that the most correct way to do logging with App Engine is to use the log package (https://godoc.org/google.golang.org/appengine/log). This, to my understanding, allows App Engine to categorize logs based on which request they are from alongside some other metadata. Do you see printouts

Re: [go-nuts] go:nosplit

2018-10-05 Thread Tyler Compton
I'm also surprised to hear that go:nosplit can be used in arbitrary packages. I would be curious to know if these directives are covered under the compatibility promise within the limited guarantees they provide. On Fri, Oct 5, 2018 at 2:47 PM Scott Cotton wrote: > Thanks much for the info. > >

Re: [go-nuts] Proposal: Implicit Method Signatures

2018-09-28 Thread Tyler Compton
When I do want to define my own custom getter, how might I tell the language that my new method is a custom getter and not just a method with no arguments and one return value? I think if Go were to have properties, they would have to be explicitly marked as a property in some way to avoid this.

Re: [go-nuts] Operator Overloading Implies Generics?

2018-09-08 Thread Tyler Compton
I believe what you're discussing in this case is function or method overloading. Operator overloading refers to the ability to specify custom behavior for operators like +, -, etc. On Sat, Sep 8, 2018 at 6:58 PM Rick wrote: > With recent discussion concerning the possible introduction of

Re: [go-nuts] Why can't we use < > for the Go generic parameters ?

2018-09-07 Thread Tyler Compton
I agree with Alan and I actually think the parentheses-based syntax is fine. In Go as it is now, there is no case where using brackets on a variable results in a call to code somewhere else in the project. It's always some kind of indexing operation. Parenthesis have a history of doing this with

Re: [go-nuts] Re: Os/Exec problematic quotation marks

2018-09-05 Thread Tyler Compton
Oh, you beat me to it :) Good luck on your project! On Wed, Sep 5, 2018 at 9:35 AM Tyler Compton wrote: > I believe what Volker is suggesting is to create your command in this way: > > cmnd := exec.Command("C:/Program Files/internet explorer/iexplore.exe", &g

Re: [go-nuts] Re: Os/Exec problematic quotation marks

2018-09-05 Thread Tyler Compton
I believe what Volker is suggesting is to create your command in this way: cmnd := exec.Command("C:/Program Files/internet explorer/iexplore.exe", "--nogui", "--start", "AGT_BANCL_CobrosManuales") Have you given this a shot? The exec.Command function expects each space-separated argument of the

Re: [go-nuts] Cross platform native(no dependencies) GUI options.

2018-05-27 Thread Tyler Compton
, May 27, 2018 at 2:57 PM <ati...@mail.ccsf.edu> wrote: > I just do not want it to have cgo and it should be perfect. > > > On Sunday, May 27, 2018 at 2:55:06 PM UTC-7, Tyler Compton wrote: > >> I'm not sure if it's actually feasible to write a GUI library without &

Re: [go-nuts] Cross platform native(no dependencies) GUI options.

2018-05-27 Thread Tyler Compton
I'm not sure if it's actually feasible to write a GUI library without external libraries. A GUI that runs Linux will need to interact with an X server or a Wayland compositer, and the library will have to interact with their APIs somehow. On Sun, May 27, 2018, 14:19 wrote:

Re: [go-nuts] Global variable not used, but it works fine

2018-04-22 Thread Tyler Compton
Go does not flag unused global variables, it is intended functionality. I've personally found that unused global variables have a higher chance at being benign than local variables, but there's probably an argument to be made for flagging globals, too. On Sat, Apr 21, 2018, 06:30

Re: [go-nuts] formatting question/issue

2018-04-09 Thread Tyler Compton
My understanding is that this is a consequence of the semicolon insertion rules Go uses. The Go parser actually uses semicolons internally, but they are inserted before parsing so that the programmer doesn't have to. Semicolons are added to the end of a line if the line ends with: - an

Re: [go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-05 Thread Tyler Compton
Go does not run in a VM like JVM and CLR languages do, but Go provides a "language as a platform"-like feel by allowing for code that is by and large platform-independent. It is true that executables have to be built for each platform but that has benefits of its own. Java applications require the

Re: [go-nuts] Re: Experience Report building OCR in Go

2018-01-18 Thread Tyler Compton
In the Error Handling section, you mention having to write a special package to capture stack traces. Would https://github.com/pkg/errors have done what you want? On Tue, Jan 16, 2018 at 6:18 AM Tad Vizbaras wrote: > I used "walk" for prototyping but found it too complex. I

Re: [go-nuts] Re: lambda syntax

2017-11-22 Thread Tyler Compton
It's usually best to create a new thread instead of responding to one that's so old (more than three years in this case). On Wed, Nov 22, 2017 at 6:28 AM wrote: > I don't know how you can live without Generics but you can't live without > Lambda expression. No Go Authors will

  1   2   >