Skip to content

Hanging when including the package on my main file. Any help? #451

Closed
@AlexandreRoba

Description

@AlexandreRoba

Hi all,

I'm trying to open a connection using the driver but it hangs the all main function when the package is imported on my main function.

I'm running Go :
go version go1.8.3 darwin/amd64
On a mac os X:
System Version: macOS 10.12.6 (16G29)
Kernel Version: Darwin 16.7.0
Boot Volume: Macintosh HD
Boot Mode: Normal
With default mac sqlite3:
3.13.0 2016-05-18 10:57:30 fc49f556e48970561d7ab6a2f24fdd7d9eb81ff2

I have added the package using dep:

# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.


[[projects]]
  name = "github.com/mattn/go-sqlite3"
  packages = ["."]
  revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08"
  version = "v1.2.0"

[[projects]]
  branch = "master"
  name = "golang.org/x/net"
  packages = ["context"]
  revision = "1c05540f6879653db88113bc4a2b70aec4bd491f"

[solve-meta]
  analyzer-name = "dep"
  analyzer-version = 1
  inputs-digest = "983b42a768fbefe59019e8df9981b7fb3b134aed5748c41fa9a096e944f3cd57"
  solver-name = "gps-cdcl"
  solver-version = 1
package main

import (
	"log"
	"github.com/mattn/go-sqlite3"
)

func main() {
	log.Print("Hello") //Never getting in there....
	driver := sqlite3.SQLiteDriver{}
	con, err := driver.Open("test.db")
	if err != nil {
		log.Fatal("Error connecting to the database")
	}
	defer con.Close()
	log.Println("Closing conenction")
}

As soon as I import the package the main function hang... No error... No time out... It simply hangs. no log is written

/usr/local/Cellar/go/1.8.3/libexec/bin/go run /Users/aroba/gocode/src/github.com/alexandreroba/todobackend/cmd/todo/main.go

I tried to create a database using the command line (sqlite3) with a table and inserting a record. It all worked well.

Any idea why this is happening ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions