Re: [go-nuts] Working with interfaces

2021-08-14 Thread Connor Kuehl
> On Aug 14, 2021, at 11:37 AM, Денис Мухортов > wrote: > > I started studying interfaces, tried to write them in different ways, but I > don't understand what I'm doing wrong. In the first case, everything works, > but I don't understand why it doesn't work in the second > SECOND > packag

[go-nuts] Re: Working with interfaces

2021-08-14 Thread Sean Liao
An interface describes a set of methods that a type needs to have You can create a variable of the type of the interface and assign instances of other types that satisfy the interface to it var o operations o = circle o.Area() // returns area of circle o = rectangle o.Area() // area of rectangle

[go-nuts] Working with interfaces

2021-08-14 Thread Денис Мухортов
I started studying interfaces, tried to write them in different ways, but I don't understand what I'm doing wrong. In the first case, everything works, but I don't understand why it doesn't work in the second FIRST package main import ( "fmt" "math" ) type Circle struct { r int } ty

Re: [go-nuts] sql.Row doubt

2021-08-14 Thread Daniel da Silva
I know my resultset will only have one row. But I don't know about columns. e.g. func GetData(db *sql.DB, ent Entity, tableName, uniqueField string, value interface{}) error { query := fmt.Sprintf("SELECT * FROM %s WHERE %s = $1", tableName, uniqueField) row := db.QueryRow(query, value

Re: [go-nuts] Re: Why isn't go more popular?

2021-08-14 Thread tapi...@gmail.com
Your attitude is very interesting. On Friday, August 13, 2021 at 6:42:15 PM UTC-4 devnet@gmail.com wrote: > Hello tapi, > > "Personally, Go will become more popular if we could develop gfx/gui apps > in Go with ease." > > I think we all here want Go to "smoke some butt" and to push beyond be

Re: [go-nuts] sql.Row doubt

2021-08-14 Thread Tamás Gulácsi
It could, but what for? sql.Row is already a convenience wrapper for I-know-I-want-only-one-row, so you know what kind of data are you retrieving, but you know it's only one row? daniel...@omie.com.br a következőt írta (2021. augusztus 13., péntek, 19:04:24 UTC+2): > Yes i ever use Query() ins