Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
/ gobolt Public archive

Commit

Permalink
Make code to build in go-1.9 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ince committed Mar 6, 2019
1 parent 172aa0d commit 0b8728e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ func createConfig(key int, uri *url.URL, config *Config, valueSystem *boltValueS
C.BoltConfig_set_routing_context(cConfig, cRoutingContext)
C.BoltConfig_set_address_resolver(cConfig, cResolver)
C.BoltConfig_set_log(cConfig, cLogger)
C.BoltConfig_set_max_pool_size(cConfig, C.int(config.MaxPoolSize))
C.BoltConfig_set_max_connection_life_time(cConfig, C.int(config.MaxConnLifetime/time.Millisecond))
C.BoltConfig_set_max_connection_acquisition_time(cConfig, C.int(config.ConnAcquisitionTimeout/time.Millisecond))
C.BoltConfig_set_max_pool_size(cConfig, C.int32_t(config.MaxPoolSize))
C.BoltConfig_set_max_connection_life_time(cConfig, C.int32_t(config.MaxConnLifetime/time.Millisecond))
C.BoltConfig_set_max_connection_acquisition_time(cConfig, C.int32_t(config.ConnAcquisitionTimeout/time.Millisecond))
C.BoltConfig_set_socket_options(cConfig, cSocketOpts)
return cConfig, nil
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func transport(config *Config) C.BoltTransport {
func createSocketOptions(config *Config) *C.struct_BoltSocketOptions {
var cSocketOpts = C.BoltSocketOptions_create()

C.BoltSocketOptions_set_connect_timeout(cSocketOpts, C.int(config.SockConnectTimeout/time.Millisecond))
C.BoltSocketOptions_set_connect_timeout(cSocketOpts, C.int32_t(config.SockConnectTimeout/time.Millisecond))
C.BoltSocketOptions_set_keep_alive(cSocketOpts, 1)
if !config.SockKeepalive {
C.BoltSocketOptions_set_keep_alive(cSocketOpts, 0)
Expand Down
4 changes: 2 additions & 2 deletions value.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (valueSystem *boltValueSystem) valueAsFloat(value *C.struct_BoltValue) floa

func (valueSystem *boltValueSystem) valueAsString(value *C.struct_BoltValue) string {
val := C.BoltString_get(value)
return C.GoStringN(val, C.BoltValue_size(value))
return C.GoStringN(val, C.int(C.BoltValue_size(value)))
}

func (valueSystem *boltValueSystem) valueAsDictionary(value *C.struct_BoltValue) (map[string]interface{}, error) {
Expand Down Expand Up @@ -145,7 +145,7 @@ func (valueSystem *boltValueSystem) structAsList(value *C.struct_BoltValue) ([]i

func (valueSystem *boltValueSystem) valueAsBytes(value *C.struct_BoltValue) []byte {
val := C.BoltBytes_get_all(value)
return C.GoBytes(unsafe.Pointer(val), C.BoltValue_size(value))
return C.GoBytes(unsafe.Pointer(val), C.int(C.BoltValue_size(value)))
}

func (valueSystem *boltValueSystem) valueToConnector(value interface{}) (*C.struct_BoltValue, error) {
Expand Down

0 comments on commit 0b8728e

Please sign in to comment.