Giter Site home page Giter Site logo

Wrong stat about vim-go HOT 10 CLOSED

fatih avatar fatih commented on June 30, 2024
Wrong stat

from vim-go.

Comments (10)

fatih avatar fatih commented on June 30, 2024

Can you give your example main.go here? I think you have an environment problem. stat is called nowhere. See: https://github.com/fatih/vim-go/blob/master/autoload/go/command.vim#L1
The $ is unknown to me.

from vim-go.

pjvds avatar pjvds commented on June 30, 2024

Thanks for the amazingly fast response!

The main.go is a simple as:

package main

import (
    "fmt"
)

func main() {
    fmt.Print("hello world")
}

I will first try a clean setup before investigating it further.

from vim-go.

fatih avatar fatih commented on June 30, 2024

It's working without any problem. Can you invoke manually your code? Maybe your Go environment is installed wrong. Below is an example output showing "hello world" printing. If you have terminal it would show it in a clean screen.

screen shot 2014-05-03 at 6 16 16 pm

from vim-go.

pjvds avatar pjvds commented on June 30, 2024

It looks like I'm at least a step further. I tried it on a clean Mac OSX environment, and it works like a charm. Yet, I also tried it on a new clean Ubuntu environment, and it still fails.

I can successfully execute the following command:

GoRun main.go

I cannot execute:

GoRun

What I find strange is that the command GoFiles returns a result with a $ sign:

$/home/pjvds/go/src/github.com/pjvds/foobar/main.go

from vim-go.

pjvds avatar pjvds commented on June 30, 2024

I was able to fix it by removing the $ from the changing files command at line 2:

Before:

let command = "go list -f $'{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}\n{{end}}'"

After:

let command = "go list -f '{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}\n{{end}}'"

from vim-go.

fatih avatar fatih commented on June 30, 2024

What shell are you using? That's a weird error.

from vim-go.

pjvds avatar pjvds commented on June 30, 2024

I have tried the following shells:

  • zsh 5.0.2 (x86_64-pc-linux-gnu) <-- my primary
  • GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)

from vim-go.

weitzj avatar weitzj commented on June 30, 2024

I could reproduce the error on Mac OSX with the fish-shell.
Edit: This was another error with subshells. Ignore my comment

Make sure to add the following to .vimrc
set shell=bash

from vim-go.

pjvds avatar pjvds commented on June 30, 2024

@weitzj: Thanks, that fixed it!
@fatih: Thanks for the support

from vim-go.

fatih avatar fatih commented on June 30, 2024

As I side note: #30 (comment)

from vim-go.

Related Issues (20)

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.