mattn/gom

gom lock

Closed this issue · 12 comments

I think, there is bug in gom/gen.go

        if isDir(filepath.Join(p, ".git")) {
            vcs = git
        } 

Gomfile:

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/awsutil'
gom 'github.com/aws/aws-sdk-go/aws/client'
gom 'github.com/aws/aws-sdk-go/aws/client/metadata'
gom 'github.com/aws/aws-sdk-go/aws/corehandlers'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds'
gom 'github.com/aws/aws-sdk-go/aws/defaults'
gom 'github.com/aws/aws-sdk-go/aws/ec2metadata'
gom 'github.com/aws/aws-sdk-go/aws/request'
gom 'github.com/aws/aws-sdk-go/aws/session'
gom 'github.com/aws/aws-sdk-go/private/endpoints'
gom 'github.com/aws/aws-sdk-go/private/protocol/query'
gom 'github.com/aws/aws-sdk-go/private/protocol/query/queryutil'
gom 'github.com/aws/aws-sdk-go/private/protocol/rest'
gom 'github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil'
gom 'github.com/aws/aws-sdk-go/private/signer/v4'
gom 'github.com/aws/aws-sdk-go/service/sns'

but .git dir is only on level https://github.com/aws/aws-sdk-go/.

Temporally workaround is manual adding in Gomfile dir with .git dir

+ gom 'github.com/aws/aws-sdk-go'
mattn commented
package main

import (
    "github.com/aws/aws-sdk-go/aws"
)

func main() {
    println(aws.UseServiceDefaultRetries)
}

Trying gom gen gomfile, then following Gomfile is generated.

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/go-ini/ini'

And do gom lock. Gomfile.lock is generated

gom 'github.com/aws/aws-sdk-go/aws'
gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/go-ini/ini'

Do you mean gom gen gomfile instead of gom lock?

Hi, thanks.

Do you mean gom gen gomfile instead of gom lock?

Nope, I want to see locked commit.
Something like this (Gomfile.lock after gom lock):

gom 'github.com/BurntSushi/toml', :commit => '056c9bc7be7190eaa7715723883caffa5f8fa3e4'
...
gom 'github.com/aws/aws-sdk-go', :commit => '9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8'
... aws stuff
mattn commented

Ah, okay. will fix in later.

Thanks!

// My workaround works with aws but not with proto

no buildable Go source files
mattn commented

Fixed. But you need to remove following lines. Or gom gen gomfile again. (NOTE that copy backup current Gomfile)

gom 'github.com/aws/aws-sdk-go/aws/awserr'
gom 'github.com/aws/aws-sdk-go/aws/awsutil'
gom 'github.com/aws/aws-sdk-go/aws/client'
gom 'github.com/aws/aws-sdk-go/aws/client/metadata'
gom 'github.com/aws/aws-sdk-go/aws/corehandlers'
gom 'github.com/aws/aws-sdk-go/aws/credentials'
gom 'github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds'
gom 'github.com/aws/aws-sdk-go/aws/defaults'
gom 'github.com/aws/aws-sdk-go/aws/ec2metadata'
gom 'github.com/aws/aws-sdk-go/aws/request'
gom 'github.com/aws/aws-sdk-go/aws/session'
gom 'github.com/aws/aws-sdk-go/private/endpoints'
gom 'github.com/aws/aws-sdk-go/private/protocol/query'
gom 'github.com/aws/aws-sdk-go/private/protocol/query/queryutil'
gom 'github.com/aws/aws-sdk-go/private/protocol/rest'
gom 'github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil'
gom 'github.com/aws/aws-sdk-go/private/signer/v4'
gom 'github.com/aws/aws-sdk-go/service/sns'

I got another problem.

Gomfile after "gom gen gomfile":

gom 'github.com/gogo/protobuf', :commit => 'd3235f01ecae4901dd9f7ea6af57a352c0189deb'
rm -rf _vendor
gom install 
...
downloading github.com/gogo/protobuf
package github.com/gogo/protobuf
        imports github.com/gogo/protobuf
        imports github.com/gogo/protobuf: no buildable Go source files in /home/XXX/Dev/go/src/gorep.qubeidea.net/cube-server/_vendor/src/github.com/gogo/protobuf
gom:  exit status 1

before your fix it was (Gomfile):

gom 'github.com/gogo/protobuf/proto'

and "gom install" was ok.

mattn commented

could you please try last commit?

Sure!

Wohoo! Looks like all is good.
Every dependency in Gomfile is with commit. Build is also good.
Thanks.

By the way. Can I update only one dependence from Gomfile with "gom update"? // If no I can do it on holidays.

mattn commented

Still not. But will do

mattn commented

added gom update. try last commit. But note that this feature is experimental. And this overwrite your Gomfile. Please try it after backup your files.