Re: [go-nuts] The Generics Proposal has been accepted!

2021-02-17 Thread Mohamed Yousif
I really don't know why you have been constantly negative.

It seems like you genuinely care about the language and what it brought to
you, and worried of what might the future bring to us. That's
understandable. But it doesn't give you the right to insult the community
this way.


On Wed, 17 Feb 2021, 1:50 pm Space A.,  wrote:

> Shit show.
>
> вторник, 16 февраля 2021 г. в 21:52:43 UTC+3, skinne...@gmail.com:
>
>> I have been so very much looking forward to Go 2.0 and generics. Getting
>> it in 1.18 is the icing on the cake. I seriously did not think you could do
>> it considering that everyone was pulling you in different directions. Well
>> Done! Defining the job is 90% of the project. The coding and testing before
>> you ship will likely be the other 90%. I am looking forward to testing the
>> new product! Thanks.
>>
>> On Friday, February 12, 2021 at 10:01:27 AM UTC-6 Amnon wrote:
>>
>>> Thanks, Ian, for the correction, and for all the hard work...
>>> All much appreciated!
>>>
>>> On Friday, 12 February 2021 at 15:49:57 UTC Ian Lance Taylor wrote:
>>>
 On Fri, Feb 12, 2021 at 7:39 AM Amnon  wrote:
 >
 > And should be out in 1.17 (this Autumn).
 >
 > Congratulations to all those who made it happen,
 > and to the Go team for making sure that the design was right before
 it
 > was accepted.

 Thanks!

 But, a clarification: we are targeting the 1.18 release for generics,
 not the 1.17 release. There is a lot of work to do.

 Ian

>>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/296b74fe-2dab-4c28-b725-76ec8905a24en%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wHQZxx1mya842QivBj8RQVWmkHaORPgp0V94zm8U11DKA%40mail.gmail.com.


Re: [go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Mohamed Yousif
How about wireguard[1]?

[1]: https://git.zx2c4.com/wireguard-go/about/

On Tue, 17 Nov 2020, 12:34 pm Nathan,  wrote:

> Hi, I want to use a general VPN protocols to comminucate with my server,
> we cannot change the client to use other VPN protocols.
> But I did a lot of research, it seems there is no go implementation for
> the general VPN.
>
> I really want that I'm wrong, so do any guys can give me some suggestion?
> Thanks in advance.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/86cecadb-81c2-46eb-8025-332cb456d9fan%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wHk8YoY4nvOe%3D%3DYEPp83uf2X4b_cDgD_%2BRM%3DiN%2BoawrEA%40mail.gmail.com.


Re: [go-nuts] rin: return if nil syntactic sugar

2020-08-31 Thread Mohamed Yousif
Dear,

On Mon, Aug 31, 2020, 4:16 AM Zakaria bin Haris  wrote:

> Hi, gophers!
>
> Idk if this has been proposed or discussed before.
>
> Given the last error handling abbreviation proposal is rejected. How about
> some simple syntactic sugar like this:
>
>   *rin* Something()
>

I love the consistency and the one way of doing things. It's indeed boring
to write 'if err ! nil', but I don't like the try catch either. Being
explicit is actually nice and errors as part of return values is more easy
to reason about.

I would rather pollute my code with if err than having two ways for return.


> Which is just a sugar for:
>
>   if err := Something(); err != nil {
> return err
>   }
>
> To make it worth the new keyword make it so that:
>
>   *rin* v := Something()
>
> equals to:
>
>   v, err := Something()
>   if err != nil {
> return err
>   }
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/955d78f2-67cb-4940-845c-034fb45e816an%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wHOD-eB%3D7A5C%3DtWW-wAPemBhXB09xQdocUwb87N1uveLQ%40mail.gmail.com.


Re: [go-nuts] First git commit for Go was in 1972? 勞

2020-08-05 Thread Mohamed Yousif
I did small google search and here are the findings

>Brian Kernighan actually wrote the first "hello, world" program as part of
the documentation for the BCPL programming language. BCPL was used while C
was being developed at Bell Labs a few years before the publication of
Kernighan and Ritchie's C book in 1972.

https://stackoverflow.com/a/12785204

On Wed, Aug 5, 2020, 11:17 AM Amarjeet Anand 
wrote:

> How come the first git commit for Go was in 1972?
>
> Anybody want to share the story behind the first 4 commits of Go project
> by  Brian Kernighan?
>
>
> https://github.com/golang/go/commits/master?after=188b2ac839f828254678d0f05a3ea953dc5d0621+4764=master
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/a0f44946-b2b5-4d55-87d8-25d20f1adc35n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wEsG1rz0vuuBCTwbhhoBQF2eT3V-e5H1xUUpVTALoWXhA%40mail.gmail.com.


Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Mohamed Yousif
It seems they are betting high on Dart/flutter and their front end is
already written with flutter. The assessment seems to be pretty much the
same as for Dart.

Dart won with the ui side, while go was competing with C.

On Tue, 25 Feb 2020 at 7:22 PM, Jon Conradt  wrote:

> The Fuchsia Programming Language Policy
> 
>  gives
> some insight into the experience the Fuchsia team has had with Go, and it
> doesn't sound good.
>
> "The Fuchsia Platform Source Tree has had negative implementation
> experience using Go. The system components the Fuchsia project has built in
> Go have used more memory and kernel resources than their counterparts (or
> replacements) the Fuchsia project has built using C++ or Rust."
>
>
> The Fuchsia Platform Source tree is defined as "The *Fuchsia Platform
> Source Tree* is the source code hosted on fuchsia.googlesource.com."
>
> Their conclusion, and each language has some issues is pretty severe.
>
>- Go is not approved, with the following exceptions:
>   - *netstack*. Migrating netstack to another language would require
>   a significant investment. In the fullness of time, we should migrate
>   netstack to an approved language.
>- All other uses of Go in Fuchsia for production software on the
>target device must be migrated to an approved language.
>
>  That's a shame. I was hoping that Fuchsia would provide a way for Go to
> have a nice GUI.
>
> Two of the issues listed as cons include the toolchain producing 'large
> binaries' and the related issue of their being a 'substantial runtime.' It
> seems to me that both of these issues can be addressed through some of the
> techniques used to build tiny Docker images from Go, but I suspect they
> would like to have a much simpler route, e.g. a go build flag.
>
> Jon
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/7778a387-f1f5-4ed0-8453-5b811bac4a6d%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wHqJnDnEVe4%3D--%3DcSW9oA-eYxcbKagESdZHgSkrdLutpA%40mail.gmail.com.


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

2019-11-14 Thread Mohamed Yousif
Is there any plans on open sourcing go.dev (the webservices behind it). It
is a little bit odd, but I'll personally learn a lot from it.

Oh, and congrats on the great work. I really liked it so much and would
definitely use it a lot over godoc.

Regards,
M

On Thu, Nov 14, 2019 at 12:00 PM Dan Kortschak  wrote:

> Yes. This is my exact concern.
>
> This has two impacts, one is the non-discoverability and the other is a
> possibility of misapprehension that the packages are in fact non-
> licensed which is an actual harm to the packages. The irony is that we
> have gone to excessive lengths to ensure that all our original sources
> have their licenses represented as well.
>
> On Thu, 2019-11-14 at 10:56 +0100, Jan Mercl wrote:
> > On Thu, Nov 14, 2019 at 5:55 AM Dan Kortschak 
> > wrote:
> >
> > > It looks like license detection needs work.
> > >
> > > See https://pkg.go.dev/gonum.org/v1/gonum?tab=overview and note it
> > > has
> > > a BSD 3 clause, as shown by GitHub's assessment (just above the
> > > "Clone
> > > or download" button) at https://github.com/gonum/gonum and the
> > > LICENSE
> > > file that it links to.
> >
> > Moreover, such packages seem to be, as a side effect, non-
> > discoverable
> > because their README and documentation are not indexed (nor
> > displayed). For example, searching for `pure go SQL database' has
> > zero
> > results.
> >
> > I don't care about automatic license recognizing, even though it's
> > admittedly a useful information for the site user. But I don't
> > understand why projects with unrecognized LICENSE file contents don't
> > show the README and the documentation.
> >
> > I'll better leave the fact of hiding even the LICENSE file per se
> > from
> > the user with the message `“Licenses” hidden due to license
> > restrictions.` without comment because I guess it's just a legal
> > issue
> > I don't understand.
> >
> > Any yes, all my packages that I tried are victims to the above
> > issues.
> > Here's an example of a recognized LICENSE vs an  unrecognized one:
> >
> > jnml@e5-1650:~/src/modernc.org/mathutil> diff -u ~/goroot/LICENSE
> > LICENSE
> > --- /home/jnml/goroot/LICENSE 2019-09-10 14:24:54.469859557 +0200
> > +++ LICENSE 2019-09-10 14:36:43.347068286 +0200
> > @@ -1,4 +1,4 @@
> > -Copyright (c) 2009 The Go Authors. All rights reserved.
> > +Copyright (c) 2014 The mathutil Authors. All rights reserved.
> >
> >  Redistribution and use in source and binary forms, with or without
> >  modification, are permitted provided that the following conditions
> > are
> > @@ -10,7 +10,7 @@
> >  copyright notice, this list of conditions and the following
> > disclaimer
> >  in the documentation and/or other materials provided with the
> >  distribution.
> > -   * Neither the name of Google Inc. nor the names of its
> > +   * Neither the names of the authors nor the names of the
> >  contributors may be used to endorse or promote products derived from
> >  this software without specific prior written permission.
> >
> > jnml@e5-1650:~/src/modernc.org/mathutil>
> >
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/7b8e08bb8429ac6b245458b33df597b783e0180b.camel%40kortschak.io
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wENOSm0kWkQojDnbdM%2B27o1a0B%2Bw4rthMUoamsPrEvFdw%40mail.gmail.com.


Re: [go-nuts] strict type assignability to prevent arbitrary values

2019-11-07 Thread Mohamed Yousif
Hi Speter,

Can you elaborate more on this point please?
> there is no memory or runtime overhead due to encapsulating the string
within a struct.


On Thu, 7 Nov 2019 at 3:15 PM, speter  wrote:

> Hi bsr,
>
> I'd suggest to use a struct type with a single string field. It will
> prevent conversion from untyped string constant "by mistake".
> Moreover, if you make the string field unexported, you can limit new
> instance creation to the declaring package, allowing to enforce predefined
> values.
> Unlike with some other languages, there is no memory or runtime overhead
> due to encapsulating the string within a struct.
>
> HTH,
> Peter
>
> On Thu, Nov 7, 2019 at 7:58 PM bsr  wrote:
>
>> Hello,
>>
>> I am a long time user of go, but I always had the impression that below
>> code would not work as string and Status are different type.
>> I thought I need to explicitly convert as ```exec(Status("abc"))``` it to
>> work.
>>
>> I think, this part of the spec may be the reason
>> https://golang.org/ref/spec#Assignability
>>
>>- x is an untyped constant 
>>representable  by a
>>value of type T.
>>
>> Is there a way I can prevent this behavior.
>> I am using Status like an enum, and only predefined status values should
>> be allowed.
>>
>>
>>
>>
>> https://play.golang.org/p/4zsb7KtPBC6
>>
>> package main
>>
>> import (
>> "fmt"
>> )
>>
>> type Status string
>>
>> func main() {
>> exec("abc")
>> }
>>
>> func exec(s Status) {
>> fmt.Printf("Hello, %s", s)
>> }
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/a20a7034-19c3-410a-bc86-25deff38534f%40googlegroups.com
>> 
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAK_MaNuSTSGGummC5cOyh%2BbR9VCovrX3xHamDLixDUWbk010Dw%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wFsOHipiy4pj2kUecEzAQ2CmoXGapjXiA%3DE%2Bwu-uanfLg%40mail.gmail.com.


Re: [go-nuts] Interface method return other interface?

2019-10-09 Thread Mohamed Yousif
I always find accept interface and return struct to be very useful. It
makes the code more cleaner.



On Wed, 9 Oct 2019 at 9:40 AM, Martin Palma  wrote:

> I'm wondering If it is ok (or good Go code) if an interface method returns
> an other interface? Here an example:
>
> type Querier interface {
>  Query() string
> }
>
> type Decoder interface {
>  DecodeAndValidate() Querier
> }
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/531f29a6-ea2e-4416-a0d0-ce697dc7a09b%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAHrL7wF00OXq0-CDR76rcF8_O%2Bs94oTRawFLP_VUoLH-RfiacQ%40mail.gmail.com.


Re: [go-nuts] Have Any One Experience With Print CSS Modules Using in Golang

2019-03-21 Thread Mohamed Yousif
I’m not quite sure but I think you can do this easier using JS.

On Thu, 21 Mar 2019 at 5:24 PM,  wrote:

> I try to make a pdf from my HTML and CSS. In CSS file there have
> some Paged Media Models.
> https://github.com/SebastiaanKlippert/go-wkhtmltopdf/ I use this library
> to generate my pdf but the problem is the Print CSS didn't work well. I am
> searching for some idea and feel free to suggest me if you have any
> solution. Thank you for your time.
>
>
> --
> 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.
>

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


Re: [go-nuts] commercial (?) password manager written in go (like lastpass, dashlane, etc.)

2019-02-26 Thread Mohamed Yousif
1password? They are sponsoring many of gopher conferences.

On Wed, 27 Feb 2019 at 3:11 AM, Pat Farrell  wrote:

> I've been reading the group for a long time, and have vague memories that
> someone from a company responded to a technical question posted with a nice
> answer and as an aside, mentioned that he worked for a company that used go
> to create a commercial password manager, using go's multi-platform and
> networking abilities.
>
> But I can't remember who, when or which company.
>
> I would like to at least consider this company and their product.
>
> Anyone remember? hints? links?
>
> 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.
>

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


Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-20 Thread Mohamed Yousif
Visual studio code has a very active GitHub repository, you can definitely
get a better support there.

On Wed, 20 Feb 2019 at 4:14 PM, Rich  wrote:

> I tried googling this but I not been able to find a solution, hopefully I
> can ask this here and someone else knows how to fix this.  I use Visual
> Studio Code -- because it's free. The issue I am having is that every time
> I use Visual Studio Code I get the popup that says:
>
> The Go extension is better with the latest version of "gocode".  Use "go
>> get -u -v github.com/mdempsky/gocode" to update
>
>
> Anyone else have this or know how to fix this? It shouldn't ask EVERY time
> I use Visual Studio Code?
>
> --
> 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.
>

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


Re: [go-nuts] GORM, saving values

2018-11-29 Thread Mohamed Yousif
Beside exporting issue, you need to commit these models into your database.
I use .Create().

On Thu, 29 Nov 2018 at 5:47 PM, Robert Engels  wrote:

> If gorm is like json marshalling the fields need to be exported, that is
> capitalized.
>
> Just a thought.
>
> On Nov 29, 2018, at 12:02 AM, mmbarighz...@gmail.com wrote:
>
> New to Go - please bear with me.
>
> I am trying to create a new row in my table, but the values are being
> saved as `Null`. Can anyone see the problem here?
>
> package main
>
> import (
>"fmt"
>"log"
>
> "github.com/jinzhu/gorm"
>_ "github.com/jinzhu/gorm/dialects/postgres"
>_ "github.com/lib/pq"
> )
>
> type contact struct {
>gorm.Model
>idint`gorm:"primary_key;not null;unique;AUTO_INCREMENT"`
>fname string `gorm:"type:TEXT"`
>lname string `gorm:"type:TEXT"`
>email string `gorm:"type:TEXT"`
> }
>
> func main() {
>connStr := "user=postgres dbname=postgres sslmode=disable"
>db, err := gorm.Open("postgres", connStr)
>
> if err != nil {
>log.Fatal(err)
>}
>
> defer db.Close()
>
> db.AutoMigrate({})
>
> c := contact{
>fname: "bob",
>lname: "job",
>email: "b...@jb.com",
>}
>
> fmt.Println()
>db.Create()
>
> }
>
> 
>
>
>
> --
> 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.
>
> 
>
> --
> 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.
>

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