GithubHelp home page GithubHelp logo

go-finder's Introduction

go-finder

$ echo -e 'https://golang.org\nhttps://golang.org' | go run main.go
Count for https://golang.org: 9
Count for https://golang.org: 9
Total: 18

go-finder's People

Contributors

romkagolovadvayha avatar

Watchers

James Cloos avatar  avatar

go-finder's Issues

Гонка записи состояния

Всё хорошо, но при запуске с детектором гонки получается следующий вывод:

echo -e 'https://golang.org\nhttps://godoc.org\nhttps://golang.org\nhttps://golang.org\nhttps://golang.org\nhttps://godoc.org\nhttps://godoc.org' | go run -race main.go
2020/01/27 09:39:36 run goroutine
2020/01/27 09:39:36 run goroutine
2020/01/27 09:39:36 run goroutine
2020/01/27 09:39:36 run goroutine
2020/01/27 09:39:36 run goroutine
Count for https://golang.org: 20
==================
WARNING: DATA RACE
Read at 0x00c0000aa110 by goroutine 20:
  github.com/romkagolovadvayha/go-finder/finder.(*Finder).Start.func1()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/finder/finder.go:48 +0x112

Previous write at 0x00c0000aa110 by goroutine 7:
  github.com/romkagolovadvayha/go-finder/finder.(*Finder).Start.func1()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/finder/finder.go:48 +0x136

Goroutine 20 (running) created at:
  github.com/romkagolovadvayha/go-finder/finder.(*Finder).Start()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/finder/finder.go:43 +0x12c
  main.main()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/main.go:18 +0x25f

Goroutine 7 (running) created at:
  github.com/romkagolovadvayha/go-finder/finder.(*Finder).Start()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/finder/finder.go:43 +0x12c
  main.main()
      /home/vp/go/src/github.com/romkagolovadvayha/go-finder/main.go:18 +0x25f
==================
Count for https://golang.org: 20
Count for https://golang.org: 20
Count for https://godoc.org: 15
Count for https://godoc.org: 15
Count for https://golang.org: 20
Count for https://godoc.org: 15
Total: 125
Found 1 data race(s)
exit status 66

Почему? И как это исправить?

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.