gin-contrib / static

Static middleware
MIT License
290 stars 41 forks source link

Removing accidentally committed vendor libraries #4

Closed pkopac closed 7 years ago

pkopac commented 7 years ago
codecov-io commented 7 years ago

Codecov Report

Merging #4 into master will not change coverage. The diff coverage is n/a.

@@          Coverage Diff          @@
##           master     #4   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          25     25           
=====================================
  Hits           25     25

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 841376c...549cda6. Read the comment docs.

pkopac commented 7 years ago

@appleboy: added the correct build step to travis, too, so now it builds and should be compatible.

appleboy commented 7 years ago

Why need Godeps? We use govendor tool for develop branch of gin.

pkopac commented 7 years ago

@appleboy: I don't know, therefore I don't remove it ;) It certainly doesn't hurt in the .gitignore, but if you want, you can remove it anytime. Is this good to go?

appleboy commented 7 years ago

Why need to update vendor folder?

You can try the following steps:

$ git clone https://github.com/gin-contrib/static.git
$ cd example/simple
$ govendor init
$ govendor fetch github.com/gin-contrib/static
$ govendor fetch github.com/gin-gonic/gin
$ go run example.go

It is working for me so I don't know this PR fix issue what you want?

pkopac commented 7 years ago

@appleboy: why do I need to update dependencies? Because that's how it's meant to be working. You are not supposed to be committing other people's code in your repository.

I never said it breaks your example. It breaks any program that uses this library, though. Because of the committed dependencies that are duplicate towards the standard Go dependency system and break on compilation: router.Use(static.Serve("/", static.LocalFile("./static", false)))

Error: (as mentioned in #1) cannot use static.Serve("/", static.LocalFile("./static", false)) (type "github.com/gin-contrib/static/vendor/github.com/gin-gonic/gin".HandlerFunc) as type "github.com/gin-gonic/gin".HandlerFunc in argument to router.Use

Do you see the vendor there? It's breaking it. The libraries shouldn't be fetched there. There should be only the config in the folder, nothing else.

appleboy commented 7 years ago

@pkopac Please remove your vendor folder first and fetch again.

fetch static library in the project using govendor tool:

$ govendor fetch github.com/gin-contrib/static

I can't see the github.com/gin-contrib/static/vendor path in vendor folder. What is your vendor tool?

pkopac commented 7 years ago

@appleboy, I am not using vendoring tools. I haven't even known about them up to now :) I'm using the original go get ./... in my builds. So no, I can't remove my vendor folder. There is none.

The problem is, you have committed the libraries inside your vendor folder, which makes it incompatible wiht standard go get ./... See the libraries, which shouldn't be there: https://github.com/gin-contrib/static/tree/master/vendor That's the path you can't see. That's it.

I removed the dependency on this library now, because I need the builds running.

appleboy commented 7 years ago

@pkopac I got your point. I will remove vendor folder.