Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

LastInsertId #15

Closed
tgulacsi opened this issue Jun 24, 2013 · 5 comments
Closed

LastInsertId #15

tgulacsi opened this issue Jun 24, 2013 · 5 comments

Comments

@tgulacsi
Copy link

golint flags LastInsertId

godrv/driver.go:160:18: func LastInsertId should be LastInsertID

'though I have to implement database/sql/Result interface, which has LastInsertId.
Can I suppress this flag?

Thanks,
GThomas

@dsymonds
Copy link
Contributor

You can't suppress it, but you could grep it out if it bothers you.

@lateefj
Copy link

lateefj commented Dec 9, 2013

autocmd BufWritePost,FileWritePost *.go execute 'Lint'| vimgrep -Ev 'Id should be ID' | cwindow

Seems to do the trick for me not sure I understand the rule on why Id should be all caps. Just wanted to drop this in to save time for future searchers with the same problem.

@dsymonds
Copy link
Contributor

dsymonds commented Dec 9, 2013

ID is in caps for the same reason that URL and HTTP are in caps; because that's Go's style for initialisms. It's regrettable that database/sql got it wrong (it should have used LastInsertID), but we are stuck with it now.

@lateefj
Copy link

lateefj commented Dec 9, 2013

I know what URL and HTTP stand for I thought Id was short for Identity I didn't realize it was two words..

@dsymonds
Copy link
Contributor

dsymonds commented Dec 9, 2013

ID is short for identity (or identification), but it's formally treated as
an initialism (see a dictionary, or signage).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants