INNER CODE UNIT · Go
compiledModules
yarpc/yarpc-go · encoding/thrift/thriftrw-plugin-yarpc/main.go:132
compiledModules := make(map[string]*compile.Module)
getCompiledModule := func(thriftFilePath string) (*compile.Module, error) {
if m, ok := compiledModules[thriftFilePath]; ok {
return m, nil
}
m, err := compile.Compile(thriftFilePath)
if err != nil {
return nil, fmt.Errorf("error compiling the thrift file: %w", err)
}
compiledModules[thriftFilePath] = m
return m, nil
}
for _, serviceID := range req.RootServices {
svc := buildSvc(serviceID, req)
compiledModule, err := getCompiledModule(svc.Module.GetThriftFilePath())
if err != nil {
return nil, err