[go-nuts] Re: Oden Language 0.3.0 released

2016-06-13 Thread Tyler Compton
another way. :) > > Den torsdag 26 maj 2016 kl. 00:47:03 UTC+2 skrev Tyler Compton: >> >> The language looks interested and I love the Oden mascot! >> >> I'm not sure if I understand the goal, though. Is this supposed to be a >> language used alongside Go code for part

[go-nuts] Re: Currying in Go

2016-06-17 Thread Tyler Compton
I would also like to hear from somebody about a real world use-case. I don't pretend to be proficient in this realm of functional programming, but I would be very surprised if this is valuable in a language like Go that can and does hold state. That said, this is very cool and I would love to

[go-nuts] Discussion on "Vendoring edge case, critical problem"

2016-06-18 Thread Tyler Compton
A user brought up a problem with the current vendoring setup regarding exposing types of a vendored dependency. There was a lot of great discussion and it seemed like there was a consensus that something needed to change, but I don't see that anything had come of it. Here is the discussion:

[go-nuts] Re: Best practice when putting large amounts of functionality behind an interface

2016-06-27 Thread Tyler Compton
k like currently? > > On Monday, June 27, 2016 at 10:54:31 PM UTC+2, Tyler Compton wrote: >> >> Right now, I have a web server with an interface that defines methods for >> every kind of database read/write operation my application has. >> > Any example ? > >

[go-nuts] Best practice when putting large amounts of functionality behind an interface

2016-06-27 Thread Tyler Compton
Right now, I have a web server with an interface that defines methods for every kind of database read/write operation my application has. Unsurprisingly, it's pretty large for a Go interface at around 30 methods. I originally did this because I wanted to be able to support multiple

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Tyler Compton
It's funny that you mention libraries using vendoring because that's been a big deal surrounding this topic. https://groups.google.com/d/msg/golang-dev/4FfTBfN2YaI/WCza__MaCgAJ On Thursday, July 28, 2016 at 4:15:06 PM UTC-7, Chad wrote: > > Actually, nevermind. I was thinking about libraries

Re: [go-nuts] Best practice for sets in go?

2016-07-26 Thread Tyler Compton
In my opinion, struct{} should always be used for placeholders. I also use it when sending to a channel where the data itself doesn't matter. struct{} looks gross but it's very expressive in this case and I think most all Go programmers are familiar with its meaning. map[string]bool suggests

[go-nuts] Re: New Context method in http.Request, what can we do with it?

2016-07-14 Thread Tyler Compton
value). Don't use context to pass app-level dependencies, as it makes >>> testing, reasoning and debugging hard. >>> >>> >>> >>> On Thursday, July 7, 2016 at 4:03:18 PM UTC-7, Tyler Compton wrote: >>>> >>>> I'm really exci

[go-nuts] Re: goimports has been updated

2016-07-14 Thread Tyler Compton
As helpful a tool as goimports is, I've really felt it slogging as of late, as well. It's great to hear that this has been given attention! On Thursday, July 14, 2016 at 10:34:36 PM UTC-7, bradfitz wrote: > > goimports has been updated. > > If you've been frustrated by its speed lately, run: > >

Re: [go-nuts] Re: Currying in Go

2016-06-20 Thread Tyler Compton
Thank you, Jesper, that's very interesting. On Sunday, June 19, 2016 at 8:15:13 AM UTC-7, Jesper Louis Andersen wrote: > > > On Sat, Jun 18, 2016 at 5:32 AM, Tyler Compton <xav...@gmail.com > > wrote: > >> I don't pretend to be proficient in this realm of functional p

Re: [go-nuts] Short vs. long variable declarations

2017-01-27 Thread Tyler Compton
While theoretically, I agree with your argument against using the short variable declaration pattern, I've personally found that in practice it isn't an issue. I think that if this is something you run into often, it might suggest that you're letting too many variables into your scope, whether

Re: [go-nuts] Can Go run on a calculator?

2017-02-22 Thread Tyler Compton
The TI-84 series uses the z80 instruction set, which isn't a compile target in Go, unfortunately. That's not to say it couldn't be, but I bet there are some more fundamental issues that would make compiling to a TI-84 impossible. I don't think Go supports any 8-bit machines. On Wed, Feb 22, 2017

[go-nuts] Re: make a struct pointer _not_ implement an interface

2016-09-12 Thread Tyler Compton
I don't believe this is possible. See the spec on method sets[1]. The excerpt I'm looking at: > The method set of any other type T consists of all methods > declared with receiver > type T. The method set of the corresponding pointer type >

[go-nuts] Re: net/http: In the infinite loop, refused all requests.

2016-09-21 Thread Tyler Compton
This issue may be of interest to you: https://github.com/golang/go/issues/10958 On Tuesday, September 20, 2016 at 7:42:24 PM UTC-7, Tony Chen wrote: > > ### What version of Go are you using (`go version`)? > go 1.6.2 mac/amd64 > > ### What operating system and processor architecture are you

[go-nuts] Re: Using EasyJSON with Golang

2016-11-14 Thread Tyler Compton
It looks like someone on Stack Overflow has answered your question[1]. You know your needs better than I do, but code generation seems like an unnecessarily complex way to unmarshal JSON code. I'd recommend taking a look at encoding/json[2] if you haven't already . 1.

[go-nuts] Modern Garbage Collection Article

2016-12-19 Thread Tyler Compton
https://medium.com/@octskyward/modern-garbage-collection-911ef4f8bd8e#.c48w4ifa7 Thoughts? How accurate is this article? If it is, why, historically, is the work being done on the GC so concentrated on pause times? For more discussion:

Re: [go-nuts] Modern Garbage Collection Article

2016-12-19 Thread Tyler Compton
tps://medium.com/@rlh_21830/it-is-not-true-that-without-compaction-fragmentation-is-inevitable-e67d111e#.fuuajmdoz On Monday, December 19, 2016 at 10:31:52 PM UTC-7, Ian Lance Taylor wrote: > > On Mon, Dec 19, 2016 at 8:56 PM, Tyler Compton <xav...@gmail.com > > wrote: > &g

Re: [go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread Tyler Compton
The documentation suggests it's a temporary API, too: "This call will go away when the scheduler improves." I don't think it should be removed, though, even if it isn't included in the compatibilty guarantee. I'd be surprised to hear if people have trouble with its semantics. It's pretty simple,

Re: [go-nuts] Inspecting a function for its arguments with reflection

2017-03-20 Thread Tyler Compton
Also, if there already exists a library that does this kind of magic for REST APIs, I'd love to hear about it. On Mon, Mar 20, 2017 at 4:01 PM Tyler Compton <xavi...@gmail.com> wrote: > I'm trying to create an HTTP request router library that automatically > decodes parameters in the

[go-nuts] Inspecting a function for its arguments with reflection

2017-03-20 Thread Tyler Compton
I'm trying to create an HTTP request router library that automatically decodes parameters in the request URL and passes them as arguments to the handler function. It would theoretically make something like this possible: myRouter.HandleFunc("/getPuppies/{id}", func(w http.ResponseWriter, r

Re: [go-nuts] Inspecting a function for its arguments with reflection

2017-03-21 Thread Tyler Compton
Thanks for the help! This is what I'm looking for. On Mon, Mar 20, 2017 at 6:32 PM Marian Kopriva wrote: > Check out https://github.com/go-martini/martini if you're looking for > some magic. > In case you don't find any magic there, then i'm sorry, i've havne't used >

Re: [go-nuts] Re: how to use go generate to generate generic code .

2017-03-10 Thread Tyler Compton
If we assume a more useful generic task than writing a min function, what's wrong with using code generation? On Fri, Mar 10, 2017 at 6:14 AM Henry wrote: > If you insist on generics-like code generation: > https://github.com/cheekybits/genny/blob/master/README.md >

Re: [go-nuts] Go one-line installer

2017-08-01 Thread Tyler Compton
> I was quite happy that the era of executable "installers" died once we > got package managers. This seems to come from a purely Linux perspective. I suspect that people who use Linux are quite a bit less likely to benefit from this solution anyway, because most Linux users are used to setting

Re: [go-nuts] Re: Go one-line installer

2017-08-03 Thread Tyler Compton
> No, most Linux users are used to installing from package managers. I don't know if that's true. Many popular distributions provide undesirably out-of-date versions of common tools and require users to use other means to install them. But both of our assertions are valueless without data, so it

Re: [go-nuts] Twitter search go code

2017-08-03 Thread Tyler Compton
I don't believe Shawn was trying to be condescending. He didn't link you to https://lmgtfy.com/ after all ;) You're likely to get better responses if you include info about your use case and the libraries you have looked at so far. On Tue, Aug 1, 2017 at 7:34 PM Tong Sun

Re: [go-nuts] Offline Go Documentation Tools

2017-07-24 Thread Tyler Compton
For cursor-sensitive help dialogs, you may find Language Server Protocol[1] interesting. It provides what you're looking for in Visual Studio Code with Go today, and will help provide that functionality to editors like [Neo]vim in the future. 1. http://langserver.org/ On Mon, Jul 24, 2017 at

Re: [go-nuts] What is Go's version of python's list data type?

2017-07-12 Thread Tyler Compton
If you're looking for a datatype in Go that stores multiple values, that would be the slice. Slices are ordered collections of data that can change in size at runtime. myIntegers := []int{5, 7, 4, 3} myStrings := []string{"hi", "there"} myStrings = append(myStrings, "gophers") The difference

Re: [go-nuts] Re: gofmt question

2017-07-02 Thread Tyler Compton
Another nice aspect of this is that formatting consistency is ecosystem-wide instead of company-wide. On Sat, Jul 1, 2017 at 9:43 AM Shawn Milochik wrote: > On Sat, Jul 1, 2017 at 11:40 AM, Glenn Hancock wrote: > >> Thanks for the responses. I guess

Re: [go-nuts] Re: Experience using Go for a student projet

2017-07-30 Thread Tyler Compton
Hi Juliusz, How did your students adjust to working with the GOPATH? I'm always interested to see how newcomers react to it. It seems to cause some people trouble. On Sun, Jul 30, 2017, 12:14 PM Juliusz Chroboczek wrote: > > I glanced at babelweb2

Re: [go-nuts] "find" for Slices like "append"

2017-08-09 Thread Tyler Compton
I think Christoph is asking the right question here. If the code you're writing requires you to search through collections of many different types all across the code base, it may make sense to use a language like Python with in-language support for searching. I think the more likely scenario is

Re: [go-nuts] Offline Go Documentation Tools

2017-08-09 Thread Tyler Compton
> Is Visual Studio Code a .Net app that takes up lots of memory and CPU? Worse, it's an Electron app :) I don't personally use VSC, so I can't speak to its performance or efficiency. However, LSP is currently supported at some level in Neovim using a plugin, and first-class support is planned.

Re: [go-nuts] Go 2 suggestion - Types like "int?"

2017-08-19 Thread Tyler Compton
I don't think it's immediately obvious what use cases this "int?" proposal delivers that aren't covered by "*int". The encoding/json package uses pointers to support null JSON values. As a more general point, when someone answers your question, they're taking time out of their day to help you. I

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-20 Thread Tyler Compton
Sent in a CL for some documentation on this. https://github.com/golang/go/issues/20717 https://go-review.googlesource.com/#/c/46212/ On Mon, Jun 19, 2017 at 10:56 AM wrote: > It won't blank as much as it can get it's hands on. The default value for > the pointer will be

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Tyler Compton
om/d/optout. >> > > -- > 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

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Tyler Compton
Very interesting. I'm not used to looking at Go code from the perspective of an implementer of Go. Somebody should contribute a comment about this upstream :) On Thu, Jun 15, 2017 at 10:34 AM Ian Lance Taylor <i...@golang.org> wrote: > On Thu, Jun 15, 2017 at 10:28 AM, Tyler Comp

Re: [go-nuts] Re: Go Code Debugging

2017-11-22 Thread Tyler Compton
If you're looking for an Eclipse-like IDE experience, you may also want to check out Goland. I don't personally use it but I've heard a lot of good things about it and it has debugging support. On Wed, Nov 22, 2017 at 8:47 AM wrote: > I think it's a nightmare

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

Re: [go-nuts] Re: awesome-go project on golang github organization

2017-10-25 Thread Tyler Compton
It may not be a good idea to put the burden of awesome-go on the Go team, since it's been pointed out in the past that they don't have extra cycles. I suspect that's still the case. On Tue, Oct 24, 2017 at 4:08 PM Dan Kortschak wrote: > I have similar sentiments.

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

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

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

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

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

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

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

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

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

  1   2   >