Re: [go-nuts] the Dominance of English in Programming Languages

2019-04-29 Thread amnonbc
We would have even more fun if we had non-latin characters in keywords 
aliases,
and supported both left-to-right and right-to-left writing directions.
But I doubt that this will make programs more readable for everyone.

On Monday, 29 April 2019 10:10:28 UTC+1, Max wrote:
>
> I am Italian, and I learned to program quite early - before really knowing 
> English.
>
> In my experience, the fact that most programming languages use English 
> keywords is not a big obstacle - for two reasons:
> 1) each programming language has very few reserved keywords - dozens at 
> most, compared to thousands of words you need to know in a new foreign 
> language.
> 2) a programming language is a **language** anyway, so the effort is 
> mostly in learning the meaning of each keyword, its syntax, and how to use 
> it.
>
> Having said that, English speakers have great advantages when studying 
> programs documentation, as most languages and libraries are **documented** 
> and commented in English.
> But in my opinion the fragmentation created by "everyone writes programs, 
> comments and docs in its own language" would be **much** worse.
>
> For reference, some years ago at work I had to integrate a program written 
> in German - identifiers, function names, even comments were in German.
> It was a nightmare, and it took months even with help from other (Italian) 
> people that knew the program and the meaning of each identifier and 
> function.
>
> Regards,
> cosmos72
>
>

-- 
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 options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Websocket vs Template

2019-05-01 Thread amnonbc
Use a websocket.

templates would give you server side rendering which will not give you live 
updates on the web page.

Steer clear of x/net/websocket which is deprecated.
Instead use the popular gorilla/websocket or the simpler nhooyr/websocket.

On Wednesday, 1 May 2019 15:11:55 UTC+1, ThisEndUp wrote:
>
> I'm new to Go and am in the design phase of a project that will display 
> live sensor data on a web page. The data are transferred via an MQTT 
> broker. I have done such things in the past using a websocket but wonder if 
> a template would be a more appropriate method. Any thoughts?
> Thanks.
>

-- 
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 options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Creating Go web server into small Docker images

2019-05-05 Thread amnonbc
try the non-shell version of Entrypoint:

ENTRYPOINT ["/myapp"]

On Saturday, 4 May 2019 17:29:16 UTC+1, sunto...@gmail.com wrote:
>
> Hi, 
>
> I'm trying to create Go web server into small Docker images. Here is 
> my Dockerfile:
>
>
> # golang:latest as build-env
> FROM golang:latest AS build-env
>
> RUN mkdir /app
> ADD . /app/
> WORKDIR /app
> RUN cd /app && GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o 
> myapp .
> # go build -o myapp
>
>
> FROM scratch
> COPY --from=build-env /app/myapp /app/images/* /
>
>
> EXPOSE 8080
> ENTRYPOINT /myapp
>
>
>
> It uses the Docker Builder Pattern and scratch image, which is a special 
> docker image that's empty. 
>
> It builds OK, but when I run it, I'm getting:
>
> docker: Error response from daemon: OCI runtime create failed: 
> container_linux.go:344: starting container process caused "exec: 
> \"/bin/sh\": stat /bin/sh: no such file or directory": unknown.
>
> How to fix it? Thx!
>
>
>

-- 
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 options, visit https://groups.google.com/d/optout.