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