Skip to content
Snippets Groups Projects
Commit 363c4f67 authored by Felix Delattre's avatar Felix Delattre
Browse files

Provided basic go project structure

parent 709dd78d
No related branches found
No related tags found
1 merge request!3Draft: Provided basic go project structure
Pipeline #19500 passed
config.toml
main
spearhead
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
image: golang:latest
variables:
REPO_NAME: git.gfz-potsdam.de/dynamicexposure/openbuildingmap/spearhead
before_script:
- go version
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
stages:
- test
- build
format:
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
compile:
stage: build
script:
- go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/spearhead
artifacts:
paths:
- spearhead
go.mod 0 → 100644
main.go 0 → 100644
/*
* spearhead
*
* Copyright (C) 2021:
* Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package main
import (
"log"
)
/*
* Main function
*/
func main() {
log.Println("Hello world")
}
/*
* spearhead
*
* Copyright (C) 2021:
* Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package main
import (
"testing"
)
func TestMain(t *testing.T) {
err := error(nil)
if err != nil {
t.Fatal(err)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment