Skip to content

Commit

Permalink
Fix (not really) problems reported by VSCode (#2790)
Browse files Browse the repository at this point in the history
VSCode reports `main redeclared` between allocationload.go and
runscenario.go due to the fact that they both look like `package main`
binaries in the same directory, similar e.g. [this poster on a
different
project](https://stackoverflow.com/questions/66970531/vs-code-go-main-redeclared-in-this-block)

To fix it, it's easy enough to just give these binaries their own
package path and fix up the calling scripts.

Along the way, fix a lint complaint in runscenario.go
  • Loading branch information
zmerlynn authored Nov 3, 2022
1 parent 3c38876 commit b397d34
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/load/allocation/runAllocation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ counter=1
while [ $counter -le $TESTRUNSCOUNT ]
do
echo "Run number: " $counter
go run allocationload.go --ip ${EXTERNAL_IP} --port 443 --namespace ${NAMESPACE} --key ${KEY_FILE} --cert ${CERT_FILE} --cacert ${TLS_CA_FILE} --numberofclients $1 --perclientallocations $2 2>>./allocation_test_results.txt
go run allocationload/allocationload.go --ip ${EXTERNAL_IP} --port 443 --namespace ${NAMESPACE} --key ${KEY_FILE} --cert ${CERT_FILE} --cacert ${TLS_CA_FILE} --numberofclients $1 --perclientallocations $2 2>>./allocation_test_results.txt
sleep 1200
((counter++))
done
2 changes: 1 addition & 1 deletion test/load/allocation/runScenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ CERT_FILE=${CERT_FILE:-client.crt}
TLS_CA_FILE=${TLS_CA_FILE:-ca.crt}
MULTICLUSTER=${MULTICLUSTER:-false}

go run runscenario.go --ip ${EXTERNAL_IP} --namespace ${NAMESPACE} \
go run runscenario/runscenario.go --ip ${EXTERNAL_IP} --namespace ${NAMESPACE} \
--key ${KEY_FILE} --cert ${CERT_FILE} --cacert ${TLS_CA_FILE} \
--scenariosFile ${1}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func readScenarios(file string) *[]scenario {
if err != nil {
logger.Fatalf("Failed opening the scenario file %s: %v", file, err)
}
defer fp.Close()
defer func() { _ = fp.Close() }()

var scenarios []scenario

Expand Down

0 comments on commit b397d34

Please sign in to comment.