Coder Social home page Coder Social logo

gcblog's Introduction

Hi there 👋

Thanks for visiting my GitHub profile, it's great to meet you here! 😊

Here are some quick things about me:

  • 🔭 I'm a pragmatic software engineer who is paranoid about convention, consistency, and constraints.
  • 🕵️‍♀️ I like doing quality work, and a real asshole on pull request reviews.
  • 🧸 I'm proud of who I am, what I have built, and what I am building.
  • 🧑‍💻 Coding is my passion.
  • 📫 The best way to reach me is to send me an email.
  • ⚡ Fun fact: I once drove to the Half Moon Bay for sun rise (hint: it's on the west coast).
  • 📰 If you like my work, please consider give my newsletter Identity, Authenticity, and Security a look!

gcblog's People

Contributors

fuxiaohei avatar huichen avatar lunny avatar slene avatar unknwon 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  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

gcblog's Issues

如何动态修改一个对象的方法?

无闻老师:
你好,有没有方法可以动态的修改一个对象的方法。

type Demo struct{
   name string
}
func (myself *Demo)GetName() string{
       return myself.name
}


func main() {
     d = &Demo{name: "xxxx"}
   // 有没有类似于这样的动态函数名称的方法呢
   d.GetName = func (my *Demo) string{
    //  ......
   }
   // 这样下面在调用d.GetName 就能更改现在的代码了   不知道怎么实现。求帮助。

}

runtime.Caller 的用法

现在runtime包下的proc.c 文件已经被go重构,

package main

import (
    "fmt"
    "runtime"
)

func main() {
    for skip := 0; ; skip++ {
        pc, file, line, ok := runtime.Caller(skip)
        if !ok {
            break
        }
        fmt.Printf("skip = %v, pc = %v, file = %v,line = %v\n", skip, pc, file, line)
    }
}

output:

skip = 0, pc = 8242, file = /Users/alex/go/src/test/runtime.go,line = 10
skip = 1, pc = 77091, file = /usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.go,line = 63
skip = 2, pc = 227777, file = /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s,line = 2232

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.