Skip to content

Instantly share code, notes, and snippets.

interface RequireContext {
keys(): string[];
(id: string): {};
}
interface RequireFunction {
context: (path: string, deep?: boolean, filter?: RegExp) => RequireContext;
}
declare var require: RequireFunction;

Keybase proof

I hereby claim:

  • I am hvoecking on github.
  • I am heye (https://keybase.io/heye) on keybase.
  • I have a public key whose fingerprint is 979D 11DB 6ECB 5B7F 03F2 3D62 37BF 26CF D843 AB80

To claim this, I am signing this object:

@hvoecking
hvoecking / translate.go
Last active September 26, 2024 12:20
Golang reflection: traversing arbitrary structures
// 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
//