Re: [go-nuts] List inside struct

2020-08-30 Thread Shyaka Rene
Thank you, it worked, everything is automatic in Go when you come from Rust
and Java, Thank you again

On Sun, Aug 30, 2020 at 2:59 AM Bakul Shah  wrote:

> Unless there is a very strong reason to use a doubly linked list, you
> should just use a slice:
>
> type Persons struct { name string; Names []string }
>
> I redid your program using the above here:
> https://play.golang.org/p/x5I1wYiCNGA
>
> Sounds like you are coming from some object oriented language background.
> Suggest reading "Effective Go": https://golang.org/doc/effective_go.html
>
> On Aug 29, 2020, at 9:35 AM, Shyaka  wrote:
>
> Hello, I need help, I have a struct Person wiith list inside, I add 5
> string on list at the end I found that the list is nil, I don't know whre
> is the error, any help is appreciated.
>
> package main
>
> import (
> "container/list"
> "fmt"
> )
>
> type Persons struct {
> name  string
> Names list.List
> }
>
> func main() {
>
> p := {
> name:  "",
> Names: *list.New(),
> }
> p.setName("John Peter")
> p.add("one")
> p.add("two")
> p.add("three")
> p.add("four")
> p.add("five")
> p.display()
>
> }
>
> func (p *Persons) setName(name string) {
> p.name = name
> }
> func (p *Persons) add(name string) {
> p.Names.PushBack(name)
> }
> func (p *Persons) display() {
> fmt.Println(p.name)
> for e := p.Names.Front(); e != nil; e = e.Next() {
> fmt.Println(e.Value)
> }
> }
>
> --
> 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/e8975da6-9af2-4660-8dbb-1a7e7e9b67cfn%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/CAOix%2Bb4R13dQFJvfSXKERaWKaUQe8u-e1WMojVg2kKh6fuJFDg%40mail.gmail.com.


Re: [go-nuts] go in cloud server

2019-04-04 Thread Shyaka Rene
Thank you very much all, now i start the tutorials to see if I can continue
with it. thank you again

On Thu, Apr 4, 2019 at 1:32 AM David Riley  wrote:

> On Apr 3, 2019, at 11:34 AM, Shyaka Rene  wrote:
> >
> >
> > Hello.
> > I'm new to go, i'm looking for a programming language to replace java. I
> have simple questions
> >   • is it a good idea to deploy go in cloud server if go is compiled
> to machine binaries, what can happen if the cloud provider changes the
> physical server to different processor architecture.
>
> This is a concern for Java, too, in that you have to have a JVM to run on.
> Go builds easily for most common cloud architectures these days (amd64,
> ppc64le, arm/aarch64, s390) and less easily for a few others (e.g. sparc).
> Do multi-architecture builds to protect yourself.
>
> If you're building for modern cloud infrastructure, you may be using
> Docker; Docker supports multi-architecture images, so if you do your build
> system correctly, you should be able to build image bundles that support a
> bunch of different architectures reasonably easily.
>
> It's maybe somewhat less easy than distributing a Java binary across
> multiple architectures, but ultimately it's probably easier than
> maintaining something that needs to run well across different Unixes and
> beyond (OpenVMS, IBM i to name a few).
>
> That said, most cloud providers aren't in the business of suddenly
> changing their entire processor architecture to something incompatible,
> unless they're Oracle.
>
> >   • does go have embedded relational database management system
> similar to h2 in java. google gives me key/value pair embedded database
> >any help is appreciated. thank you
>
> Go has lots of interfaces to lots of databases, from key/value (memcached,
> Redis, bdb) to relational (an flexible SQL interface with drivers for most
> popular RDBs including sqlite) to popular non-SQL databases (Couchbase,
> Mongo, etc).  Others on the list have also pointed out a few other embedded
> ones available for Go of which I wasn't aware, so that's very exciting.
>
>
> - Dave
>
>

-- 
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] go in cloud server

2019-04-03 Thread Shyaka Rene

Hello.
I'm new to go, i'm looking for a programming language to replace java. I 
have simple questions

   1. is it a good idea to deploy go in cloud server if go is compiled to 
   machine binaries, what can happen if the cloud provider changes the 
   physical server to different processor architecture.
   2. does go have embedded relational database management system similar 
   to h2 in java. google gives me key/value pair embedded database
   
   any help is appreciated. thank you

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