9ec8b67392
* Add golangci-lint as linting tool * Disable failing staticchecks to start; GitHub issue to handle coming soon * Run `goimports -w` to repair all source files that have improperly formatted imports * makefile: Add ci-lint target to run on travis This change adds a new make target for running golangci-lint on newly added Go files only. This target is expected to run during Packer ci builds. * .github/contributing: Add code linting instructions * travis: Update job configuration to run parallel builds
27 lines
449 B
Go
27 lines
449 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/packer/builder/vsphere/driver"
|
|
)
|
|
|
|
func main() {
|
|
d, err := driver.NewDriver(&driver.ConnectConfig{
|
|
VCenterServer: "vcenter.vsphere65.test",
|
|
Username: "root",
|
|
Password: "jetbrains",
|
|
InsecureConnection: true,
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
ds, err := d.FindDatastore("", "esxi-1.vsphere65.test")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
fmt.Println(ds.Name())
|
|
}
|