Code Monkey home page Code Monkey logo

gospal's Introduction

๐Ÿ‘‹

gospal's People

Contributors

nickng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gospal's Issues

_unexported_ channels

_unexported_ channels sometimes appear in inferred types by migoinfer. This should not happen.

Error in goroutine's MiGo type

The MiGo types extracted for this program twobuyers.go have an issue. For the buyer1 goroutine migoinfer gets the order and type of operations right, but the operations are presented as happening on the same channel, when in the program they happen on different channels.

These are the generated MiGo types: twobuyers.cgo
As can be seen on lines 25, 26 and 27 the operations are erroneously presented as happening on the same channel.

Unparsable MiGo types generated when net package is imported.

The following program will generate unparsable MiGo types because of importing the net package.
Moreover, the generated os.NewFile# functions degenerate to an empty channel operation (tau).

package main
import (
  "fmt"
  "time"
  "net"
)

func Send(ch chan<- int) {
	ch <- 42
}

func Recv(ch <- chan int, done chan<- int) {
	val:= <-ch
	done<-val
}


func Work() {
	for {
		fmt.Println("Working...")
		time.Sleep(1*time.Second)
	}
}


func main() {
	ch, done := make(chan int), make(chan int)
	
	
	conn, err := net.Dial("tcp", "localhost:5678")
	if err != nil {
		fmt.Println(err)
	}
	_ = conn // this is to prevent unused variable error
	
	go Send(ch)
	go Recv(ch,done)
	go Recv(ch,done)
	go Work()
	
	<-done
	<-done
	
}

migoinfer: cannot be used concurrently

Inferer cannot be used concurrently. It may lead to runtime crash concurrent map read/write for constant storage and others.

Potential source: callctx.Toplevel() uses a shared storage.

Error in struct flattening

In the program examplewithstruct.go the channels are encapsulated in a struct which is passed as a pointer to the two goroutines. endChannel is used to signal to main that a goroutine is exiting and is not part of the struct.

examplewithstruct.cgo contains the MiGo types extracted by migoinfer for examplewithstruct.go.
I bring your attention to lines 11 and 12. In line 11, endChannel appears as the first argument in the function call, while in line 12 it appears as the last parameter.

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.