{"id":16918163,"url":"https://github.com/vito/go-repl","last_synced_at":"2025-03-17T07:31:20.242Z","repository":{"id":751316,"uuid":"404142","full_name":"vito/go-repl","owner":"vito","description":"A Go REPL. Builds up a source .go file over time, compiles it for output.","archived":false,"fork":false,"pushed_at":"2014-04-03T14:36:01.000Z","size":190,"stargazers_count":207,"open_issues_count":6,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T19:57:54.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vito.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-07T18:12:09.000Z","updated_at":"2025-01-29T17:33:26.000Z","dependencies_parsed_at":"2022-08-06T12:30:07.108Z","dependency_job_id":null,"html_url":"https://github.com/vito/go-repl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vito%2Fgo-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vito%2Fgo-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vito%2Fgo-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vito%2Fgo-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vito","download_url":"https://codeload.github.com/vito/go-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852429,"owners_count":20358267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T19:39:02.117Z","updated_at":"2025-03-17T07:31:19.948Z","avatar_url":"https://github.com/vito.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"A compiling Go REPL.\n\nBuilds up Go source as the session goes on, compiles and runs it with every input.\n\nA \"!\" in front of the input means it's in \"unstable\" mode, e.g. a package has been imported and isn't used, or errors occur in the source.\n\nExample session:\n\n    Welcome to the Go REPL!\n    Enter '?' for a list of commands.\n    \u003e ?\n    Commands:\n        ?\thelp\n        + (pkg)\timport package\n        - (pkg)\tremove package\n        -[dpc]\tpop last (declaration|package|code)\n        ~\treset\n        : (...)\tadd persistent code\n        !\tinspect source\n    \u003e a := 6\n    \u003e b := 7\n    \u003e println(a * b)\n    42\n    \u003e + fmt\n    ! fmt\u003e fmt.Println(\"Hello, world!\")\n    Hello, world!\n    ! fmt\u003e println(\"This won't work since fmt doesn't get used.\")\n    Compile error: /tmp/gorepl.go:2: imported and not used: fmt\n\n    ! fmt\u003e : fmt.Print()\n    fmt\u003e println(\"Now it will!\")\n    Now it will!\n    fmt\u003e func b(a interface{}) { fmt.Printf(\"You passed: %#v\\n\", a); }\n    fmt\u003e b(1)\n    Compile error: /tmp/gorepl.go:14: cannot call non-function b (type int)\n\n    fmt\u003e !\n    package main\n    import \"fmt\"\n\n    func b(a interface{})\t{ fmt.Printf(\"You passed: %#v\\n\", a) }\n\n    func noop(_ interface{}) {}\n\n    func main() {\n        a := 6;\n        noop(a);\n        b := 7;\n        noop(b);\n        fmt.Print();\n    }\n\n    fmt\u003e -d\n    fmt\u003e !\n    package main\n    import \"fmt\"\n\n    func noop(_ interface{}) {}\n\n    func main() {\n        a := 6;\n        noop(a);\n        b := 7;\n        noop(b);\n        fmt.Print();\n    }\n\n    fmt\u003e func dump(a interface{}) { fmt.Printf(\"You passed: %#v\\n\", a); }\n    fmt\u003e dump(\"Phew, there we go.\")\n    You passed: \"Phew, there we go.\"\n    fmt\u003e -d\n    fmt\u003e -c\n    ! fmt\u003e - fmt\n    \u003e + math\n    ! math\u003e println(math.Pi)\n    +3.141593e+000\n    ! math\u003e + fmt\n    ! math fmt\u003e fmt.Println(math.Pi)\n    3.1415927\n    ! math fmt\u003e \n\nTODO: Write automatic test with the above example session as input and expected output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvito%2Fgo-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvito%2Fgo-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvito%2Fgo-repl/lists"}