Re: [go-nuts] What are debian:buster-slim advantages vs alpine ones?

2020-12-18 Thread Mirko Friedenhagen
Just to followup here: in the company I work for we discarded usage of Alpine and settled on Debian because: * Alpine has no process for handling CVEs * Alpine's musl libc has subtle differences to glibc which led to strange problems (we use Java a lot) * When building images for Python or Ruby p

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

2019-05-07 Thread Mirko Friedenhagen
Well, back in the 90s the Microsoft Office Basic dialects were internationalized so you could write something like "Für Alle Zellen In DieseArbeitsMappe.ArbeitsBlätter[5]" instead of "for all cells in ThisWorkmap.WorkSheets[5]". But you could open/run this only with a German version of Excel 4.0

[go-nuts] Is there a reason the cert used by httptest.StartTLSServer(...) is not valid for localhost?

2019-03-23 Thread Mirko Friedenhagen
Sorry, I should have read your post more thoroughly. You probably know this all. Regards Mirko -- 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+unsubs

[go-nuts] Is there a reason the cert used by httptest.StartTLSServer(...) is not valid for localhost?

2019-03-23 Thread Mirko Friedenhagen
Hello, SSL does not care about IPs or network rules, only about the content of certificates. If you want reach something via SSL and state the IP, the certificate has to be valid for the IP. You need to add two subjectAlternativeNames when creating your certificate; 127.0.0.1 and localhost For

Re: [go-nuts] Replacing the current go process with os.execvpe

2018-10-16 Thread Mirko Friedenhagen
Thanks, syscall.Exec seems to be what I want then. Am Dienstag, 16. Oktober 2018 17:02:46 UTC+2 schrieb Ian Lance Taylor: > > On Tue, Oct 16, 2018 at 7:13 AM, Mirko Friedenhagen > > wrote: > > > > I am on my way to replace a Python script which writes several > conf

[go-nuts] Replacing the current go process with os.execvpe

2018-10-16 Thread Mirko Friedenhagen
Hello everybody, I am on my way to replace a Python script which writes several configuration files before replacing itself with another program (e.g. bash). For that I use https://docs.python.org/3/library/os.html#os.execv. Is there any equivalent in Golang? I do not use any fancy go routines

[go-nuts] Custom Types and conversions.

2018-09-17 Thread Mirko Friedenhagen
Hello, I like to work with stronger types so I try to avoid strings. Given I have some JSON like --- const _test_data = ` { "name" : "myname", "uri" : "https://example.com/mycontext"; } ` --- What I really would like to have is something like: --- type Repository struct { Name string

Re: [go-nuts] Golang equivalent of Python's context manager

2018-09-12 Thread Mirko Friedenhagen
Thanks again. I think some of the use cases, especially those which implement some kind of finally (which includes locking use case) may just be implemented with simple functions. At least throwing exceptions is a rare event in Golang (panicking is what I meant with rare). Are closures, like th

Re: [go-nuts] Golang equivalent of Python's context manager

2018-09-12 Thread Mirko Friedenhagen
First of all, thanks for all the answers. A standard use case in Python is to use with the a closing context manager which will just call close on a given object. That one could be easily done with a defer statement. However, coming from Java lately, retrieving a DB-connection from a pool, open

[go-nuts] Golang equivalent of Python's context manager

2018-09-12 Thread Mirko Friedenhagen
Hello, in Python I may define context managers which do stuff before and after an action has taken place. E.g.: ``` class MyContext(object): def __enter__(self): print("Entering context") def __exit__(self, extype_unused, value_unused, traceback_unused): print("Exiting c

Re: [go-nuts] Gitlab CI loses its marbles attempting go get.

2018-09-11 Thread Mirko Friedenhagen
And BTW, when you use Golang 1.11 you should definitely look into using „go mod“ for dependencies which offers pip freeze and pip install -r. The good thing is, that you do not need to symlink your project into the GOPATH then :-) -- You received this message because you are subscribed to the G

Re: [go-nuts] Gitlab CI loses its marbles attempting go get.

2018-09-11 Thread Mirko Friedenhagen
Hello Eric, if you host your project at gitlab.com, you may use any Docker image available at the standard docker hub, e.g. https://hub.docker.com/_/golang/ Depending on whether you choose the alpine or Debian based image, you may easily install Python, this is in my experience less cumbersome

Re: [go-nuts] go module for library developer workflow

2018-09-05 Thread Mirko Friedenhagen
The problem with replace is when you want to integrate this within a CI. Hello, IMO it would be be good, if I could specify a’s version with a branch name like “master” in b’s go.mod and had a way to call something like go mod pkg in a, which would compile a and put it in the pkg folder, maybe t

Re: [go-nuts] Re: How to setup your development environment using Go modules

2018-09-02 Thread Mirko Friedenhagen
Publishing to the local cache is how Maven, a build tool for Java, does it. There is the concept of snapshot versions. For Golang maybe stating master (or any other branch) as version would be fitting. Then your CI could use a master checkout as well. Regards Mirko -- You received this messag