mirror of
				https://github.com/3ybactuk/marketplace-go-service-project.git
				synced 2025-10-30 05:53:45 +03:00 
			
		
		
		
	init
This commit is contained in:
		
							
								
								
									
										13
									
								
								make/build.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								make/build.mk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| .PHONY: build | ||||
|  | ||||
| cart-build: | ||||
| 	cd cart && GOOS=linux GOARCH=amd64 make build | ||||
|  | ||||
| loms-build: | ||||
| 	cd loms     && GOOS=linux GOARCH=amd64 make build | ||||
|  | ||||
| notifier-build: | ||||
| 	cd notifier && GOOS=linux GOARCH=amd64 make build | ||||
|  | ||||
| comments-build: | ||||
| 	cd comments && GOOS=linux GOARCH=amd64 make build | ||||
							
								
								
									
										43
									
								
								make/lint.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								make/lint.mk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| CURDIR=$(shell pwd) | ||||
| BINDIR=${CURDIR}/bin | ||||
| GOVER=$(shell go version | perl -nle '/(go\d\S+)/; print $$1;') | ||||
| LINTVER=v1.60.3 | ||||
| LINTBIN=bin/golangci-lint | ||||
|  | ||||
|  | ||||
| bindir: | ||||
| 	mkdir -p ${BINDIR} | ||||
|  | ||||
|  | ||||
| install-lint: bindir | ||||
| 	test -f ${LINTBIN} || \ | ||||
| 		(GOBIN=${BINDIR} go install github.com/golangci/golangci-lint/cmd/golangci-lint@${LINTVER} && \ | ||||
| 		mv ${BINDIR}/golangci-lint ${LINTBIN}) | ||||
|  | ||||
| define lint | ||||
| 	@if [ -f "$(1)/go.mod" ]; then \ | ||||
| 		output=$$(${LINTBIN} --config=.golangci.yaml run $(1)/... 2>&1); \ | ||||
| 		exit_code=$$?; \ | ||||
| 		echo "$$output"; \ | ||||
| 		if [ $$exit_code -ne 0 ]; then \ | ||||
| 			if echo "$$output" | grep -q "no go files to analyze"; then \ | ||||
| 				exit 0; \ | ||||
| 			else \ | ||||
| 				exit $$exit_code; \ | ||||
| 			fi \ | ||||
| 		fi \ | ||||
| 	fi | ||||
| endef | ||||
|  | ||||
|  | ||||
| cart-lint: | ||||
| 	$(call lint,cart) | ||||
|  | ||||
| loms-lint: | ||||
| 	$(call lint,loms) | ||||
|  | ||||
| notifier-lint: | ||||
| 	$(call lint,notifier) | ||||
|  | ||||
| comments-lint: | ||||
| 	$(call lint,comments) | ||||
		Reference in New Issue
	
	Block a user
	 irylkov
					irylkov