[go-nuts] sql/driver: why the Result.LastInsertId method doesn't follow the Go's style for Initialisms?

2017-04-20 Thread ariel
While working with the driver package, I had to implement the Result 
interface. my first instinct was to write the LastInsertId method as 
"LastInsertID", but then the build failed and I figured out what was the 
problem.

What's the reason that the Result interface doesn't follow the Go's style 
for Initialisms 
? (I'm 
not complaining, I'm just curious...)

-- 
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] ent: an entity framework for Go

2019-10-03 Thread Ariel Mashraki
Yes. PostgreSQL support will be added soon.
You can track its progress in our roadmap to v1 - 
https://github.com/facebookincubator/ent/issues/46

On Thursday, October 3, 2019 at 7:52:01 PM UTC+3, Marcin Romaszewicz wrote:
>
> That looks very nice, congrats! I like that it's simple and doesn't try to 
> solve every problem, just simple relationships, so you can solve most of 
> your simple DB schema needs (and most DB usage is quite simple in most 
> services).
>
> Do you have any plans to add a Postgres driver?
>
> -- Marcin
>
> On Thu, Oct 3, 2019 at 8:11 AM Noam Schachter  > wrote:
>
>> Hi gophers,
>>
>> My team at Facebook Connectivity has just open-sourced a new ORM for Go 
>> and would love your feedback about it.
>> GitHub repo at: https://github.com/facebookincubator/ent
>> Story behind it in our blog post: 
>> https://entgo.io/blog/2019/10/03/introducing-ent/ 
>>
>> Thanks!
>> Noam
>>
>> -- 
>> 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 golan...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/16a50745-1744-4fe5-be93-aca2b96fcebc%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/f9b7637c-e946-46b0-adc0-59612ea81662%40googlegroups.com.


[go-nuts] labeled loop vs for statement inlining

2016-08-29 Thread Ariel Mashraki
 

Hello,

Running `go build -gcflags -m` on the given code below will produce:


   main.go:3: can inline f1

   main.go:24: inlining call to f1


Can someone please explain why doesn't the f2 function get inlined ?

Thanks



package main

func f1() int {

   i := 0

loop:

   if i > 10 {

   return i

   }

   i++

   goto loop

}

func f2() int {

   i := 0

   for {

   if i > 10 {

   return i

   }

   i++

   }

}


func main() {

   f1()

   f2()

}


-- 
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] labeled loop vs for statement inlining

2016-08-29 Thread Ariel Mashraki
I didn't know it has more levels. thanks 

On Monday, August 29, 2016 at 6:09:19 PM UTC+3, Sam Whited wrote:
>
> On Mon, Aug 29, 2016 at 9:40 AM, Ariel Mashraki 
> > wrote: 
> > Can someone please explain why doesn't the f2 function get inlined ? 
>
> If you build with m=2 (go build -gcflags -m=2) it will spit out a reason: 
>
> > cannot inline f2: unhandled op for 
>
> (closures with "for" in them apparently can't be inlined) 
>
> —Sam 
>
>
>
> -- 
> Sam Whited 
> pub 4096R/54083AE104EA7AD3 
>

-- 
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] Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ariel Mashraki
Giving these 2 statements (in main function), the first passes and the 
second causes a parse-error.

type T struct{}
func (T) F() bool { return true } 

func main() {
v := T{}.F() // works
if v := T{}.F(); v {} // syntax error: cannot use v := T as value
}

I went over the grammar rules of the "If Statement 
" and it contains a "
SimpleStatement ". The 
"SimpleStatement" contains the same "Assignment 
" rule that is used for general 
assignments. The first works, but the second fails. Any thoughts what's the 
difference between the 2 assignments?  

I can overcome this by just using "if v := (T{}).F()", but curious to know 
the reason. 

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/55cfc01d-376d-4cf9-83c4-be9b13380ea8n%40googlegroups.com.


Re: [go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ariel Mashraki
Good to know that.

Thanks for your response Ian. 

On Thursday, October 15, 2020 at 6:42:33 PM UTC+3 Ian Davis wrote:

> On Thu, 15 Oct 2020, at 4:16 PM, Brian Candler wrote:
>
> It looks like a parsing ambiguity to me.  The error suggests that the 
> open-brace is being treated as the start of the body of the if-statement, 
> i.e.
>
> if v := T {
> }.F()
>
> Try changing it to
>
> if v == T{}.F(); v {}
>
> and you'll get a different error: "syntax error: unexpected . at end of 
> statement"
>
>
> It is a parsing ambiguity and is mentioned in the specification towards 
> the end of https://golang.org/ref/spec#Composite_literals
>
>
>

-- 
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/a1163161-4f55-4ef6-b7e6-cea6ba63ddd2n%40googlegroups.com.