Date: 2021-12-23
Accepted
vim.g.mapleader = "," | |
vim.opt.filetype="on" | |
vim.opt.filetype.indent="on" | |
vim.opt.filetype.plugin="on" | |
vim.opt.encoding="utf-8" | |
vim.opt.syntax="on" | |
vim.opt.compatible=false |
{ | |
"languageserver": { | |
"go": { | |
"command": "gopls", | |
"rootPatterns": ["go.mod"], | |
"trace.server": "verbose", | |
"filetypes": ["go"] | |
} | |
} | |
} |
❯ tree internal/ | |
internal/ | |
├── datastore | |
│ ├── file1.go | |
│ ├── file2.go | |
│ ├── fileN.go | |
├── api | |
│ ├── file1.go | |
│ ├── file2.go | |
│ ├── fileN.go |
let mapleader = "," | |
filetype on | |
filetype indent on | |
filetype plugin on | |
set encoding=UTF-8 | |
syntax on | |
set nocompatible |
"-- vim-go specific configuration | |
" run :GoBuild or :GoTestCompile based on the go file | |
function! s:build_go_files() | |
let l:file = expand('%') | |
if l:file =~# '^\f\+_test\.go$' | |
call go#test#Test(0, 1) | |
elseif l:file =~# '^\f\+\.go$' | |
call go#cmd#Build(0) | |
endif |
#!/bin/bash | |
# | |
# scripts/test.sh | |
# | |
# * Generates `coverage/index.html`: HTML artifact for download, | |
# * Generates `coverage/report.xml`: report of failed tests in Junit format, and | |
# * Validates the minimum code coverage still applies. | |
# | |
# Depends on: | |
# * github.com/jstemmer/go-junit-report |
# vim: set syntax=dockerfile: | |
FROM node:9.9.0-alpine | |
RUN apk --update upgrade && \ | |
apk add python && \ | |
npm config set loglevel error && \ | |
npm install -g [email protected] && \ | |
apk del python && \ | |
rm -rf /var/cache/apk/* |
package main | |
import ( | |
"fmt" | |
) | |
type GreetingsService interface { | |
SayHello() string | |
SayGoodMorning() string | |
} |
# How to dynamically create model classes in PostgreSQL and ActiveRecord? | |
require 'active_record' | |
class ModelFactory < ActiveRecord::Base | |
self.abstract_class = true | |
class << self | |
def build_model(params) | |
schema = params[:schema] | |
table = params[:table] |