Code Monkey home page Code Monkey logo

Comments (12)

unknwon avatar unknwon commented on May 13, 2024

What is your Go version and macaron version?

from macaron.

unknwon avatar unknwon commented on May 13, 2024

OK, I see the problem. Header() is an method, not a field. So use it as follows:

ctx.Resp.Header().Set("Content-Description", "File Transfer")

from macaron.

limianwang avatar limianwang commented on May 13, 2024

Great. I will give it a try later and let you know. Thanks!

from macaron.

limianwang avatar limianwang commented on May 13, 2024

Weird, I am still getting this error:

ctx.Resp.Header().set undefined (type http.Header has no field or method set)

and my code is:

ctx.Resp.Header().set("X-Test-Header", "aa")

Edit: Found my error. set was used instead of Set

from macaron.

limianwang avatar limianwang commented on May 13, 2024

It is not complaining anymore. I'll do some test to make sure it's properly written, but thanks again!

from macaron.

unknwon avatar unknwon commented on May 13, 2024

@limianwang you should really learn basics of Go before start doing anything!

from macaron.

limianwang avatar limianwang commented on May 13, 2024

Yeah. That's what i'm doing by pocking around. :) Do you have any suggestions?

from macaron.

unknwon avatar unknwon commented on May 13, 2024

@limianwang Based on your user name I suppose you can read Chinese, my video tutorials should help you out: https://github.com/Unknwon/go-fundamental-programming

from macaron.

limianwang avatar limianwang commented on May 13, 2024

Yes, I will watch it now. 我先看看。 谢谢!

from macaron.

unknwon avatar unknwon commented on May 13, 2024

If you have further questions, you can post them on http://golanghome.com/ or join QQ group 371440803 , I'm there :bowtie:

from macaron.

limianwang avatar limianwang commented on May 13, 2024

@unknwon Ok sounds good. I don't have QQ, but do you have other groups? (ie. slack/gitter?)

from macaron.

unknwon avatar unknwon commented on May 13, 2024

https://gitter.im/Unknwon this link should work.

from macaron.

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.