Re: [go-nuts] High Performance REST API Framework.

2020-05-09 Thread Kurtis Rader
On Sat, May 9, 2020 at 10:57 AM Sai Matam wrote: > What would be a high performance web framework? I am looking for:- > Googling "go caddy gin echo" produces a lot of results. One of those is the Caddy web server. I use Caddy for my personal web server and have been very happy using it rather th

Re: [go-nuts] High Performance REST API Framework.

2020-05-09 Thread David Riley
I like Echo (echo.labstack.com) a lot. Nice and modular, more capable than Gin with about the same performance, and I think it meets all of your criteria (except having never used Spring Boot before, I don't know how it compares). - Dave > On May 9, 2020, at 12:39 AM, Sai Matam wrote: > > W

Re: [go-nuts] Set environment variables from command line argument

2020-05-09 Thread Amarjeet Anand
It worked. Exactly what I was looking for. Thanks a lot. On Sun, 10 May, 2020, 7:44 AM Kurtis Rader, wrote: > On Sat, May 9, 2020 at 7:04 PM Amarjeet Anand > wrote: > >> Is it possible to set environment variables while running my app like... >> >> *go run -env_var1="val1" main.go* >> > > Is th

Re: [go-nuts] Set environment variables from command line argument

2020-05-09 Thread Kurtis Rader
On Sat, May 9, 2020 at 7:04 PM Amarjeet Anand wrote: > Is it possible to set environment variables while running my app like... > > *go run -env_var1="val1" main.go* > Is there some reason you can't simply do this env_var1=val1 go run main.go Or this env env_var1=val1 go run main.go

[go-nuts] Why I fear Go

2020-05-09 Thread shammah Zealsham Agwor
Thanks to everyone that answered. Helped alot . I'm gonna keep focusing on go -- 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...@googlegroup

[go-nuts] Set environment variables from command line argument

2020-05-09 Thread Amarjeet Anand
Hi Is it possible to set environment variables while running my app like... *go run -env_var1="val1" main.go* And then access *env_var* value as - *os.Getenv("env_var1")* I know, we can access command line arguments in go and set it manually as environment variables. But am asking if there i

Re: [go-nuts] Re: High Performance REST API Framework.

2020-05-09 Thread Rodolfo
I liked this: https://gofiber.io/ For now, Its seems better to me. Em sáb., 9 de mai. de 2020 às 18:27, escreveu: > Hi there, > > I've had quite a success with https://github.com/gin-gonic/gin, super > fast and feels similar to lumen/laravel (php) and express (nodejs). > > Cheers, > Dimitrios

Re: [go-nuts] Re: Trampoline example

2020-05-09 Thread Gert
On Sunday, May 10, 2020 at 12:33:08 AM UTC+2, Ian Lance Taylor wrote: > > On Sat, May 9, 2020 at 12:56 PM Gert > > wrote: > > > > This is the closest I get, I am out of ideas. Don't know why it runs but > doesn't update the string. > > I don't know what you are really trying to do, but I wan

Re: [go-nuts] Can we maintain a per P epoll fd to make netpoll scalable?

2020-05-09 Thread Ian Lance Taylor
On Sat, May 9, 2020 at 8:32 AM Cholerae Hu wrote: > > I'm maintaining a highly-loaded proxy-like service, which serves huge amount > of small rpc requests every day. Yesterday I profiled it, and found that > runtime.netpoll took 8.5% cpu(runtime.mcall took 20% cpu). > > There is only one global

Re: [go-nuts] Re: Trampoline example

2020-05-09 Thread Ian Lance Taylor
On Sat, May 9, 2020 at 12:56 PM Gert wrote: > > This is the closest I get, I am out of ideas. Don't know why it runs but > doesn't update the string. I don't know what you are really trying to do, but I want to be clear that this code is not supported. The supported way to call from Go to C is

[go-nuts] Re: High Performance REST API Framework.

2020-05-09 Thread dpsarrou
Hi there, I've had quite a success with https://github.com/gin-gonic/gin, super fast and feels similar to lumen/laravel (php) and express (nodejs). Cheers, Dimitrios On Saturday, May 9, 2020 at 8:57:23 PM UTC+3, Sai Matam wrote: > > What would be a high performance web framework? I am looking

[go-nuts] Request to update https://github.com/gonuts/go-shellquote

2020-05-09 Thread normanr
https://github.com/gonuts/go-shellquote is 9 commits behind https://github.com/kballard/go-shellquote. Could someone push the latest commits to the gonuts branch? Thanks Norman -- - Norman Rasmussen - Email: nor...@rasmussen.co.za - Home page: http://norman.rasmussen.co.za/ -- You receive

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Dan Kortschak' via golang-nuts
Yes, sorry. Eight years of habit is hard to break. I think I agree with you; a small bit of text in https://golang.org/ref/spec#Type_definitions linking to https://golang.org/ref/spec#Predeclared_identifiers and saying that there exist already defined types may ease this, or the suggestion you ha

[go-nuts] Re: Why I fear Go

2020-05-09 Thread Ryan Rank
My advice: forget the word "Senior." They're looking for a developer with something resembling a track record. Failing that, they'll look for a developer with a good approach to solving the problem the program is designed to solve. If you want to gain experience, you can contribute to an open s

[go-nuts] Re: Trampoline example

2020-05-09 Thread Gert
This is the closest I get, I am out of ideas. Don't know why it runs but doesn't update the string. go run . test [116 101 115 116 0 0 0 0 0 0] 4 0 0 #include #include int hello(char *s) { char c[80]; strcpy (c, s); sprintf(s, "hello %s", c); printf("--\n"); return 0; } #include "te

Re: [go-nuts] Why I fear Go

2020-05-09 Thread Michael Jones
I have hired many people over the years, run companies, bought companies, and make VC investment decisions now, which are almost the same task. In every case there is the minimum qualification and the personal magic you bring above or outside that. The desire for "senior" means "skills and experien

Re: [go-nuts] Why I fear Go

2020-05-09 Thread Chris Burkert
Don't be afraid of the term "senior". The process prior to signing a contract is mutual application. The company advertises itself like the candidate advertises himself. Of course companies want the best developers so they attract these with "senior" and other terms. But sometimes you don't get wha

[go-nuts] Re: Why I fear Go

2020-05-09 Thread Gert
On Saturday, May 9, 2020 at 7:57:23 PM UTC+2, shammah Zealsham Agwor wrote: > > I have been programming since 2016 but I have never really dived deep into > any language and haven't got a job with any . I decided to change all that > and focus with every soul in me on golang. But I have my fear a

[go-nuts] Re: Why I fear Go

2020-05-09 Thread Saied Seghatoleslami
You should go for it. If you think you can, or you think you can't, in both cases you are right. On Saturday, May 9, 2020 at 1:57:23 PM UTC-4, shammah Zealsham Agwor wrote: > > I have been programming since 2016 but I have never really dived deep into > any language and haven't got a job with a

[go-nuts] Why I fear Go

2020-05-09 Thread shammah Zealsham Agwor
I have been programming since 2016 but I have never really dived deep into any language and haven't got a job with any . I decided to change all that and focus with every soul in me on golang. But I have my fear as every go job I have seen are looking for senior developers. And from what I notic

[go-nuts] High Performance REST API Framework.

2020-05-09 Thread Sai Matam
What would be a high performance web framework? I am looking for:- 1. Reactive (non-blocking) 2. Enough HTTP compatibility to implement a REST API 3. Would be great if it feels like Spring Boot or Swagger 4. Well maintained. 5. Should be able to scale to tens of thousands of connec

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Axel Wagner' via golang-nuts
Dan: I don't know why you are talking about "named type". The nomenclature is outdated and obsoleted by "defined type". The only reason I see to still use it is so you can make an argument that "it has a name" means "it's a defined type" - which isn't even a correct argument anymore since type ali

[go-nuts] Can we maintain a per P epoll fd to make netpoll scalable?

2020-05-09 Thread Cholerae Hu
I'm maintaining a highly-loaded proxy-like service, which serves huge amount of small rpc requests every day. Yesterday I profiled it, and found that runtime.netpoll took 8.5% cpu(runtime.mcall took 20% cpu). There is only one global epoll fd in runtime, but every P will call netpoll. Inside ke

[go-nuts] Re: Trampoline example

2020-05-09 Thread Gert
I am getting it to compile and run with this but I am struggling how you send a string pointer across a syscall that c can send back. Also not sure about the //go:nosplit I sprinkel around which one is actually right? package main import ( "syscall" "unsafe" "golang.org/x/sys/unix" ) //go:

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread Brian Candler
> This thread isn't "please help me understand how the language works", it's "does the spec accurately and unambiguously define how the language works". Sure, I'm happy to stick to that. Can you tell me if you agree that the spec is clear on this point: that if I write type MyError interface

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Dan Kortschak' via golang-nuts
In https://golang.org/ref/spec#Types a Type is defined in terms of a TypeName a TypeLit or a (Type). A TypeName is what makes a type a named type. This is defined as either an identifier or a qualified identifier. For the discussion here we can ignore the latter. An identifier contains letters and

[go-nuts] Re: [ANN] sorty

2020-05-09 Thread Serhat Şevki Dinçer
Hello, sorty v1.0 was released with: - Concurrent dual partitioning (for initial long ranges) - Median-of-5 / 9 pivotting with scheduling - Sub-range assistive pivotting - Simplified api (no interfaces) - Other small improvements Let me know what you think, Cheers

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Axel Wagner' via golang-nuts
> > Every name that represents a type and does not stand for a type alias > is a defined, formerly named type. The essence is in the existence of > the name for the type. If it's declared in user code of magically by > the compiler does not matter. Can you tell me where the spec says any of this?

Re: [go-nuts] Re: handling constant of maps

2020-05-09 Thread Amarjeet Anand
Thanks Kevin for your opinion. Now am assured that variable way works. I will use that. On Wed, 6 May, 2020, 11:08 PM 'Kevin Chowski' via golang-nuts, < golang-nuts@googlegroups.com> wrote: > I would do (and have done) what you suggested in your last example, but > just put the codes into a 'var

[go-nuts] Trampoline example

2020-05-09 Thread Gert
Hi, this is the smallest example I can think of but I have know idea how I am suppose to do the syscall and trampoline part? ./c/hello.c - #include #include int hello(char *s) { char c[80]; strcpy (c, s); sprintf(s, "hello %s", c); return 0; } clang -shared -fpic hello.c -o h

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread Brian Candler
>From a language user's point of view, the following understanding seems to work: - A named ("defined") type has one or more names ("identifiers") - A type definition creates a new named type, distinct from all others - An alias declaration adds a new name to an existing type This does beg the q

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread Brian Candler
On Friday, 8 May 2020 21:58:42 UTC+1, Axel Wagner wrote: > > • The section on error *doesn't* > specifically point this out. This, really, is where we can argue about > reading the spec. > - It doesn't use the specific word "defined type" at least and it doesn

Re: [go-nuts] Failed to schedule cron job at night

2020-05-09 Thread 'Vikram Ingawale' via golang-nuts
Thanks for your help. I am using go 1.14.0 Ok I’m updates it to 1.14.2 and then checking Tonight On Sat, 9 May 2020 at 1:01 PM, Brian Candler wrote: > I left that program running overnight. This morning I found: > > root@builder:~# go get github.com/gin-gonic/gin > go get gopkg.in/robfig/cron

[go-nuts] interface vs functions for mocking

2020-05-09 Thread Amarjeet Anand
Hi While writing unit test, what should be the preferred way to mock an external(database, http...) call, *function based approach* or *interface based approach?* I don't understand when to use function way and when to use interface way. Which one is more idiomatic Golang way if I am writing my we

Re: [go-nuts] Failed to schedule cron job at night

2020-05-09 Thread Brian Candler
I left that program running overnight. This morning I found: root@builder:~# go get github.com/gin-gonic/gin go get gopkg.in/robfig/cron.v2 root@builder:~# go get gopkg.in/robfig/cron.v2 root@builder:~# go run x.go [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery mi

[go-nuts] Re: Too many open files / broken pipe issue.

2020-05-09 Thread Uli Kunitz
Please read the section about timeouts in https://blog.cloudflare.com/exposing-go-on-the-internet/ very carefully. This should explain your file descriptor issues. The broken pipe and connection resets are probably clients that closed connections because of timeouts on their side, which may a