This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree 4 files changed +74
-4
lines changed
4 files changed +74
-4
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,17 @@ contexts too.
8
8
Installation
9
9
------------
10
10
11
- Once you have [ installed Go] [ golang-install ] , install the ` mockgen ` tool:
11
+ Once you have [ installed Go] [ golang-install ] , install the ` mockgen ` tool.
12
+
13
+ To get the latest released version use:
12
14
13
15
``` bash
14
- go get github.com/golang/mock/mockgen
16
+ GO111MODULE=on go get github.com/golang/mock/mockgen@latest
15
17
```
16
18
17
- _ Note: It is recommended to have ` GO111MODULE=on ` to ensure the correct
18
- dependencies are used._
19
+ If you use ` mockgen ` in your CI pipeline, it may be more appropriate to fixate
20
+ on a specific mockgen version.
21
+
19
22
20
23
Documentation
21
24
-------------
Original file line number Diff line number Diff line change @@ -53,12 +53,18 @@ var (
53
53
copyrightFile = flag .String ("copyright_file" , "" , "Copyright file used to add copyright header" )
54
54
55
55
debugParser = flag .Bool ("debug_parser" , false , "Print out parser results only." )
56
+ version = flag .Bool ("version" , false , "Print version." )
56
57
)
57
58
58
59
func main () {
59
60
flag .Usage = usage
60
61
flag .Parse ()
61
62
63
+ if * version {
64
+ printVersion ()
65
+ return
66
+ }
67
+
62
68
var pkg * model.Package
63
69
var err error
64
70
if * source != "" {
Original file line number Diff line number Diff line change
1
+ // Copyright 2019 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ // +build !go1.12
16
+
17
+ package main
18
+
19
+ import (
20
+ "log"
21
+ )
22
+
23
+ func printVersion () {
24
+ log .Printf ("No version information is available for Mockgen compiled with " +
25
+ "version 1.11" )
26
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2019 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+
16
+ // +build go1.12
17
+
18
+ package main
19
+
20
+ import (
21
+ "fmt"
22
+ "log"
23
+ "runtime/debug"
24
+ )
25
+
26
+ func printVersion () {
27
+ if bi , exists := debug .ReadBuildInfo (); exists {
28
+ fmt .Println (bi .Main .Version )
29
+ } else {
30
+ log .Printf ("No version information found. Make sure to use " +
31
+ "GO111MODULE=on when running 'go get' in order to use specific " +
32
+ "version of the binary." )
33
+ }
34
+
35
+ }
You can’t perform that action at this time.
0 commit comments