mirror of
				https://github.com/therootcompany/go-gitver.git
				synced 2024-11-16 17:08:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			389 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			389 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # Example
 | |
| 
 | |
| Prints the version or a nice message
 | |
| 
 | |
| # Doesn't have a separate tools package
 | |
| 
 | |
| This is just like `examples/basic`,
 | |
| but it uses a normal file with a build tag
 | |
| rather than a tools package.
 | |
| 
 | |
| See `examples/basic` for more details.
 | |
| 
 | |
| # Demo
 | |
| 
 | |
| ```bash
 | |
| go mod tidy
 | |
| go mod vendor
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| go generate -mod=vendor ./...
 | |
| go build -mod=vendor -o hello *.go
 | |
| ./hello
 | |
| ./hello --version
 | |
| ```
 |