This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible | |
| " let mapleader = "\<space>" | |
| let mapleader = "," | |
| filetype plugin indent on | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'Valloric/YouCompleteMe' | |
| Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
| Plug 'junegunn/fzf.vim' | |
| Plug 'neomake/neomake' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Traverses an arbitrary struct and translates all stings it encounters | |
| // | |
| // I haven't seen an example for reflection traversing an arbitrary struct, so | |
| // I want to share this with you. If you encounter any bugs or want to see | |
| // another example please comment. | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2014 Heye Vöcking | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com | |
| type MacBook struct { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com | |
| type Computer interface { | |
| GetOwner() string | |
| GetName() string | |
| PowerOn() | |
| Shutdown() error | |
| Restart() error | |
| SetGreetingMsg() | |
| PlaySong(s string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package embedding | |
| import "testing" | |
| type mockMacBook struct { | |
| } | |
| func (s mockMacBook) GetOwner() string { | |
| return "Mock Anuchit MacBook" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package embedding | |
| type Computer interface { | |
| GetOwner() string | |
| GetName() string | |
| PowerOn() | |
| Shutdown() error | |
| Restart() error | |
| SetGreetingMsg() | |
| PlaySong(s string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package embedding | |
| import "testing" | |
| type mockMacBook struct { | |
| Computer | |
| } | |
| func (s mockMacBook) GetOwner() string { | |
| return "Mock Anuchit MacBook" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "testing" | |
| func mockGetName() string { | |
| return "Mock Get Name" | |
| } | |
| func TestMockGetStudentName(t *testing.T) { | |
| funcGetName = mockGetName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| func getName() string { | |
| return "Anuchit Prasertsang" | |
| } | |
| var funcGetName = getName | |
| func GetStudentName() string { | |
| name := funcGetName() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " | |
| " activate pathogen | |
| " | |
| set runtimepath+=~/.vim/autoload/pathogen.vim | |
| execute pathogen#infect() | |
| filetype on | |
| filetype plugin indent on | |
| " |