#go-nuts

/

      • ahmadaal
        Wessie: i.e not using an ORM at all, or just a different one
      • PapaSierra joined the channel
      • Wessie
        is the problem really with the orm in that case? what are you having problems with
      • firstdayonthejob has quit
      • khodafez joined the channel
      • khodafez has left the channel
      • atomical joined the channel
      • ahmadaal
        Lack of documentation, I guess. For e.g How to have a User model that has many languages, but not duplicate the languages if multiple users have the same one
      • danhardman has quit
      • Wessie: I guess also willing to explore other options, if the community has recommendations for web-app persistence
      • Wessie
        a lot of people go with plain database/sql with eventually a switch to sqlx
      • although I'm sure success stories of gorm exist
      • _blizzy_ joined the channel
      • PapaSierra has quit
      • rutkowski has quit
      • Silverfall joined the channel
      • centrinia joined the channel
      • splinny has quit
      • splinny joined the channel
      • ahmadaal has quit
      • azr joined the channel
      • SpNg joined the channel
      • kentquirk joined the channel
      • bambucha has quit
      • pregressive has quit
      • tschottdorf joined the channel
      • Sly joined the channel
      • solvip joined the channel
      • xcor joined the channel
      • xcor has quit
      • spgingras joined the channel
      • kaiza joined the channel
      • nsf has quit
      • thecarlhall has quit
      • azr joined the channel
      • ahmadaal joined the channel
      • azr joined the channel
      • ahmadaal
        id love to talk to someone with a success story
      • tennix1 joined the channel
      • Danishman has quit
      • rho joined the channel
      • rho has quit
      • rho joined the channel
      • _blizzy_ has quit
      • domino14 joined the channel
      • ilyaz joined the channel
      • owen1
        i want to separate my db related files into it's own package. in server.go i have import https://botbot.me/files/freenode/go-nuts/"github.com/oren/user/dbhttps://botbot.me/files/freenode/go-nuts/". when i try to build server.go i see: server.go:5:2: cannot find package https://botbot.me/files/freenode/go-nuts/"github.com/oren/user/dbhttps://botbot.me/files/freenode/go-nuts/" any tips?
      • frenata has quit
      • mwhooker joined the channel
      • _blizzy_ joined the channel
      • danthemyth joined the channel
      • jkyle joined the channel
      • SpNg has quit
      • KBme
      • dmarkham joined the channel
      • znpy joined the channel
      • owen1
        KBme: ok. does the db.go file must be inside a folder called db?
      • edulix joined the channel
      • KBme: as soon as i moved db.go into a folder called db i don't get the error anymore
      • saadq has quit
      • danthemyth has quit
      • velco has quit
      • mwhooker joined the channel
      • djhworld has quit
      • KBme
        owen1, you should have one package per directory. in one or multiple files that doesn't matter. file names don't matter either.
      • terakilobyte joined the channel
      • Argue has quit
      • owen1
        KBme: got it
      • pkircher joined the channel
      • pkircher has quit
      • epiris has quit
      • inside the db folder i have db.go. it has a function that seed my db with some data. but when i run 'go build db.go' i don't see an executable.
      • KBme
        owen1, read the documentation. this is not how it works.
      • ghodss has quit
      • owen1
        KBme: oh. ok
      • DragonPunch has quit
      • interesting. if i change the package in db.go file to main, the build is fine.
      • so only main will output an executable?
      • KBme
        yes
      • owen1
        i would like to have more than 1 executable: server and also seed. server will run my webserver and seed will insert stuff into my db.
      • i try to use go as a replacement to bash, i guess.
      • ohlol joined the channel
      • leb joined the channel
      • sgambino has quit
      • raja has quit
      • DragonPunch joined the channel
      • r0fl_ joined the channel
      • mishak joined the channel
      • lluad
        owen1: You can have multiple directories with main in, each will create an executable. They can pull in modules from yet other directories to share code.
      • _cyril_ joined the channel
      • r0fl has quit
      • sp4rrow joined the channel
      • SpNg joined the channel
      • cwandrews has quit
      • ohlol has quit
      • mistermocha joined the channel
      • iraj_ has quit
      • cwandrews joined the channel
      • _cyril_ has quit
      • pkircher joined the channel
      • r0fl_ has quit
      • FrostCandy
        How would you append a slice to a slice of slices? s1 = make([][]string) s2 = []string{https://botbot.me/files/freenode/go-nuts/"onehttps://botbot.me/files/freenode/go-nuts/",https://botbot.me/files/freenode/go-nuts/"twohttps://botbot.me/files/freenode/go-nuts/"} s1 = append(s1, []{s2...})
      • _jesse_
        s1 = append(s1, s2) ? if you just want to add the s2 slice as the last element of s1
      • Vendan
        wooo, that's fun, https://play.golang.org/p/mD3-FFRgW2 Parser combinator library with a working math expression calculator
      • momomomomo joined the channel
      • owen1
        lluad: cool!
      • aztecmew joined the channel
      • Illya
        is there a way to pass either a []double64 or a []complex128 to functions of the same name? i.e. in C you could have two function definitions which have the same name with different types
      • Vendan
        Illya, not without breaking either compile time type safety or declaring the []double64 or whatever as a type and attaching methods to them
      • lluad
        There's no compile-time overloading, Illya. I think the go-style approach would be to have functions with different names, or to have the functions take an interface and have wrappers arount your arrays that implement that interface.
      • cwandrews has quit
      • Illya
        :( ok
      • PapaSierra joined the channel
      • lluad
        . o O ( everything you've learned about the smoothest path to a solution from c++ is probably unhelpful in go )
      • sztanpet
        Illya c doesnt have that, only c++
      • FrostCandy
        _jesse_: thanks, I got fooled. I had an unrelated error, then changed my append statement, then read the error. That's what you get for assuming. :)
      • Illya
        sztanpet: oh... thought it was C
      • _blizzy_ has quit
      • _cyril_ joined the channel
      • daito joined the channel
      • kevinjos joined the channel
      • kevinjos
        Is there a simple mechanism for making a deep copy of a struct?
      • PapaSierra has quit
      • safe joined the channel
      • foobaz has quit
      • Vendan
        does the struct have fields that are pointers?
      • kevinjos
        Vendan: Yes, as well as slices
      • Vendan: In fact, it has slices of pointers
      • Vendan
        hrm, that gets fun
      • dvheumen has left the channel
      • are they all public fields, or are there any private fields
      • demilux joined the channel
      • kevinjos
        public
      • Vendan
      • dd0 joined the channel
      • ohlol joined the channel
      • kevinjos
        thank you Vendan, I will give this a try
      • djbkd joined the channel
      • FrostCandy
        Hmm, https://play.golang.org/p/B_tMAyAuC5 I still can't seem to append a []string to a [][]string properly. This doesn't give any errors, but slice[0] and slice[1] end up the same instead of appending slice[1] to slice[0]
      • znpy joined the channel
      • FIFOd joined the channel
      • dd0 has quit
      • Vendan
        that's normal, you are reusing the slice
      • _blizzy_ joined the channel
      • FrostCandy
        Vendan: ok thanks
      • kevinjos
        Vendan: code.google.com/p/rog-go/exp/deepcopy does not compile in go1.5
      • safe has quit
      • snyp joined the channel
      • FIFOd has quit