Coder Social home page Coder Social logo

Comments (6)

sisyphsu avatar sisyphsu commented on June 30, 2024

Got it, I will fix it before tomorrow.

from slf4go.

sisyphsu avatar sisyphsu commented on June 30, 2024

@ms-clovis I have fix this issue in version v1.0.4.

slf4go don't use github.com/go-eden/etime and github.com/huandu/go-tls anymore, now it only requires github.com/go-eden/common, which is maintained by myself.

You could run go get -u -t ./... to update versions, after that the go.mod should like:

require (
    ......
    github.com/go-eden/slf4go v1.0.4
)

from slf4go.

ms-clovis avatar ms-clovis commented on June 30, 2024

Thank you for your prompt attention. I am still getting the following (as part of common)

github.com/go-eden/common/etime

C:\Go_Projs\pkg\mod\github.com\go-eden\[email protected]\etime\etime_now.go:23:20: invalid operation: tv.Sec * 1000 + int64(tv.Usec) / 1000 (mismatched types int32 and int64)
C:\Go_Projs\pkg\mod\github.com\go-eden\[email protected]\etime\etime_now.go:32:20: invalid operation: tv.Sec * 1e+06 + int64(tv.Usec) (mismatched types int32 and int64)

from slf4go.

ms-clovis avatar ms-clovis commented on June 30, 2024

These are the changes necessary in etime_now.go:

func NowMillisecond() int64 {
var tv syscall.Timeval
if err := syscall.Gettimeofday(&tv); err != nil {
return time.Now().UnixNano() / 1e6
}
return int64(tv.Sec*1e3) + int64(tv.Usec)/1e3
}

// NowMicrosecond obtains the current microsecond, use syscall for better performance
func NowMicrosecond() int64 {
var tv syscall.Timeval
if err := syscall.Gettimeofday(&tv); err != nil {
return time.Now().UnixNano() / 1e3
}
return int64(tv.Sec*1e6) + int64(tv.Usec)
}

from slf4go.

sisyphsu avatar sisyphsu commented on June 30, 2024

OK... now I find the reason.

In linux and osx, the datatype of syscall.Timeval.Sec is int64, but in windows, it is int32, this is really unexpected...

I have commit it into the new release v1.0.5, you could try it.

Thank you for all.

from slf4go.

ms-clovis avatar ms-clovis commented on June 30, 2024

Thank you for your time

from slf4go.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.